/*
Theme Name: Paper
Theme URI: https://yayu.net/projects/wordpress-paper
Author: Jeff Chen
Author URI: https://yayu.net/
Description: 一页纸，一片让博主可写可绘的极简空间。本主题为极简主题，禅定黄+静思蓝暗黑配色，无 JS、图片文件引用。主题支持自定义背景、自定义菜单，保留搜索及评论功能；内置文章归档模板；已作中文字体优化，内置3种字体方案可选。
Tags: blog, one-column, full-width-template, minimalism, responsive, dark-mode, free
Version: 1.4.9
License: CC BY-NC-SA 4.0 DEED
License URI: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-hans
*/

:root {
    --width: 720px;
    --font-yahei: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",Helvetica,Arial,"PingFangSC-Regular","Hiragino Sans GB","Lantinghei SC","Microsoft Yahei","Source Han Sans CN","WenQuanYi Micro Hei",SimSun,sans-serif;
    --font-fangsong: Baskerville, "Times New Roman", "Liberation Serif", STFangsong, FangSong, FangSong_GB2312, "CWTEX\-F", serif;
    --font-songti: Georgia, "Nimbus Roman No9 L", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;
    --font-scale: 1em;
    --background-color: #F2F0E5;
    --main-color:#fff;
    --heading-color: #222;
    --nav-color:#666;
    --text-color: #444;
    --link-color: #444;
    --code-background-color: #f2f2f2;
    --code-color: #222;
    --border-color: #ddd;
    --blockquote-color: #222;
    --gray-color: #999;
    --shadow-color:#ebe4c6;
    /* 新增：强调色（链接 / 当前菜单 / 悬浮按钮） */
    --accent-color: #3457d5;
    --link-color: #3457d5;
    --text-color: #3b3b3b;
    --header-bg: #fbfaf4;
    --header-border: #e4e0d2;
    --radius: 8px;
  /* 卡片内边距：恢复被误清的左右留白，三栏对齐 */
  --gutter: clamp(18px, 5.5%, 52px);
}
@media (prefers-color-scheme: dark) {
:root {
    --background-color: #0b0c1b;
    --main-color: #0e1028;
    --heading-color: #c2cef0;
    --nav-color: #585c90;
    --text-color: #aeb9d6;
    --link-color: #8aa0ff;
    --code-background-color: #000;
    --code-color: #ddd;
    --border-color: #7b88c8;
    --blockquote-color: #ccc;
    --gray-color: #4f5287;
    --shadow-color: #000;
    /* 新增：强调色（暗色） */
    --accent-color: #8aa0ff;
    --header-bg: #0c0e20;
    --header-border: #23264a;
    --radius: 8px;
    }
}
body {
    font-family: var(--font-yahei); /* 可替换 --font-fangsong 或 --font-songti 字体 */
    font-size: 17px; /* 提升正文基础字号，优化长文阅读 */
    margin: auto;
    padding: 20px;
    max-width: var(--width);
    text-align: left;
    background-color: var(--background-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.8;
    color: var(--text-color);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
html{scroll-behavior:smooth;}
h1,h2,h3,h4,h5,h6{color:var(--heading-color);}
a{color:var(--link-color);cursor:pointer;text-decoration:none}
a:hover{opacity:0.6;}
nav a{margin-right:10px}
strong,b{color:var(--heading-color)}
button{margin:0;cursor:pointer}
time,.comment-meta a{color:var(--gray-color);}
main{padding:24px var(--gutter) 56px; background-color:var(--main-color);box-shadow: 0px 10px 20px 0px var(--shadow-color);}
table{width:100%}
hr{border:0;border-top:1px dashed}
img{max-width:100%;height:auto}
code{font-family:monospace;padding:2px;background-color:var(--code-background-color);color:var(--code-color);border-radius:3px}
blockquote{border-left:1px solid var(--gray-color);color:var(--code-color);padding-left:20px;font-style:italic}
footer{padding:20px 0;margin: 10px 0;color:var(--gray-color);}
footer a{color:var(--nav-color)}
/* 页脚信息：版权 → RSS/Sitemap/协议 → ICP/公安（顺序与后台一致） */
.site-footer{
  padding:26px var(--gutter) 46px;margin:26px 0 0;
  border-top:1px solid var(--header-border);
  color:var(--gray-color);font-size:13px;line-height:1.7;
}
.footer-row{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;
  gap:10px 20px;
}
.copyright{color:var(--gray-color);}
.copyright a{color:var(--nav-color);text-decoration:none;}
.copyright a:hover{color:var(--accent-color);}
.footer-links{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;}
.flink{display:inline-flex;align-items:center;gap:5px;color:var(--nav-color);font-size:13px;text-decoration:none;}
.flink:hover{color:var(--accent-color);}
.flink .ic{width:14px;height:14px;}
.footer-beian{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;margin-top:12px;font-size:12px;letter-spacing:.2px;}
.footer-beian-link{color:var(--gray-color);text-decoration:none;}
.footer-beian-link:hover{color:var(--accent-color);}
.ic{width:18px;height:18px;display:block;flex:0 0 auto;}

.home article,.archive article,.search article{margin-bottom: 40px;padding-bottom:40px;border-bottom:1px dashed var(--gray-color);}
h1.title,h2.title {margin:0;line-height:1.6;}
.intro{color:var(--gray-color);margin-bottom:18px;}
/* 归档 / 分类 / 标签 / 搜索页头部：紧凑化、与正文同宽对齐 */
.archive-head{margin:0 0 14px;}
.archive-title{margin:0;font-size:1.15em;font-weight:700;line-height:1.4;}
.archive-meta{margin:6px 0 0;color:var(--gray-color);font-size:.9em;}
/* 文章列表标题：紧凑、与正文同宽对齐 */
.home .title,.archive .title,.search .title{font-size:1.22em;line-height:1.45;font-weight:700;}
.single .title,.page .title{font-size:1.5em;line-height:1.4;}
/* 文章列表底部：日期（左） + 阅读全文（右） */
.post-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;}
.post-date{color:var(--gray-color);font-size:.85em;}
.single .content,.page .content{margin-top: 50px;}
.content a,.comment .reply a{border-bottom:1px solid var(--link-color);}
.content a:has(img){border:none}
/* 单篇文章正文底部：分类 + 标签（可点击） */
.post-meta-bottom{margin-top:40px;padding-top:18px;border-top:1px dashed var(--gray-color);font-size:.9em;line-height:2;}
.post-meta-bottom .meta-label{color:var(--gray-color);margin-right:2px;}
.post-meta-bottom a{color:var(--accent-color);text-decoration:none;margin-right:12px;}
.post-meta-bottom a:hover{opacity:.75;}
.post-meta-bottom .post-cats{margin-bottom:6px;}
/* 广告位：不干扰阅读排版，容器溢出隐藏避免撑破布局 */
.paper-ad{margin:0;line-height:1;}
.paper-ad--global-top{margin:0 0 22px;}
.paper-ad--global-bottom{margin:22px 0 0;}
.paper-ad--single{margin:30px 0 6px;}
.paper-ad--center{text-align:center;}
.paper-ad--left{text-align:left;}
.paper-ad--right{text-align:right;}
.paper-ad img{max-width:100%;height:auto;}
.paper-ad ins.adsbygoogle{display:block;}
.paper-ad > *{max-width:100%;}
form > *:last-child{margin-bottom:0}
label{font-size:0.9em;}
input[type="text"],input[type="email"],input[type="url"],input[type="search"],textarea{background:transparent;border-radius:4px;border:1px solid var(--border-color);box-shadow:none;display:block;margin:0 0 15px 0;padding:12px;width:100%}
textarea{line-height:1.5;height:100px}
textarea:focus,input[type="email"]:focus,input[type="search"]:focus,input[type="text"]:focus,input[type="url"]:focus{border:1px solid var(--gray-color);outline:0}
button,.button,input[type="button"],input[type="reset"],input[type="submit"]{background-color:var(--link-color);border:none;border-radius:4px;color:#fff;display:inline-block;font-family:inherit;font-size:16px;margin:0;padding:8px 16px 10px;text-align:center}
button:hover,.button:hover,input[type="button"]:hover,input[type="reset"]:hover,input[type="submit"]:hover{cursor:pointer;opacity:.7}
#comments,#respond{margin-top:40px;padding-top:40px;border-top:1px dashed var(--gray-color);}
.commentlist,.commentlist .children{list-style: none;padding:0;margin-bottom:40px;}
.comment{margin:30px 0;list-style: none;}
.comment .comment{margin-left:50px}
.comment-author cite{font-weight:bold;font-style:normal;}
.comment-author .says,.comment-author .avatar{display:none}
.logged-in .comment-respond .comment-reply-title{margin-bottom:20px}
.comment-respond p + p{margin-top:20px}
.comment-respond .comment-form-author,.comment-respond .comment-form-email{float:left;margin:10px 0;width:calc( 50% - 10px );max-width:calc(100% - 25px);}
.comment-respond .comment-form-email{margin-left:20px}
.comment-respond label{display:block}
.comment-respond input,.comment-respond textarea{padding:10px;max-width:calc(100% - 25px);}
.comment-respond input[type="checkbox"] + label{display:inline;font-size:14px;margin:0 0 0 5px}
.closed{margin-top:20px}
#cancel-comment-reply-link{float:right;font-weight: normal;}
.searchform input{margin:12px 8px 14px 0;width: initial;display:inline-block;}
.results{list-style:none;padding:0;}
.results li{margin:20px 0 0;}

/* =========================================================
   阅读体验优化
   ========================================================= */
p{margin:0 0 1.1em;}
.content > p:last-child,
.page .content > *:last-child{margin-bottom:0;}
h1,h2,h3,h4,h5,h6{line-height:1.4;font-weight:700;margin:1.3em 0 .55em;}
h1{font-size:1.6em;}
h2{font-size:1.32em;}
h3{font-size:1.15em;}
h4{font-size:1.08em;}
h5,h6{font-size:1em;}
.content a,
.comment .reply a{border-bottom:1px solid var(--accent-color);color:var(--accent-color);}
.content a:hover{opacity:.78;}

/* =========================================================
   顶栏菜单（仿 12313.icu 的 ma-menu 设计）
   ========================================================= */
.site-header{
  position:sticky;top:0;z-index:900;
  background:var(--header-bg);
  border-bottom:1px solid var(--header-border);
  -webkit-backdrop-filter:saturate(180%) blur(8px);
  backdrop-filter:saturate(180%) blur(8px);
}
.site-header-inner{
  max-width:var(--width);margin:0 auto;padding:6px var(--gutter);
  display:flex;flex-direction:column;align-items:stretch;gap:4px;
}
.site-header-brand{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 0 4px;}
.site-logo{
  font-weight:700;font-size:1.1em;color:var(--heading-color);
  white-space:nowrap;text-decoration:none;min-width:0;
}
.site-logo:hover{color:var(--accent-color);}
.ma-menu{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--header-border);padding-top:5px;}
.ma-menu-list{
  display:flex;align-items:center;justify-content:center;flex:1 1 auto;flex-wrap:nowrap;
  gap:3px 16px;list-style:none;margin:0;padding:0;
  overflow-x:auto;-webkit-overflow-scrolling:touch;
}
.ma-search{flex:0 0 auto;display:flex;align-items:center;}
.ma-search input[type="search"]{
  width:150px;max-width:42vw;height:30px;font-size:14px;font-family:inherit;
  padding:4px 10px;border:1px solid var(--border-color);border-radius:999px;
  background:var(--background-color);color:var(--text-color);
  transition:border-color .15s ease,width .15s ease;
}
.ma-search input[type="search"]:focus{outline:0;border-color:var(--accent-color);}
.ma-menu .menu-item{position:relative;flex:0 0 auto;}
.ma-menu .menu-item > a{
  display:inline-block;padding:3px 2px;color:var(--nav-color);
  font-size:15px;line-height:1.25;text-decoration:none;transition:color .15s ease;
}
.ma-menu .menu-item > a:hover{color:var(--accent-color);}
.ma-menu .menu-item.current-menu-item > a,
.ma-menu .menu-item.current_page_item > a,
.ma-menu .menu-item.current-menu-ancestor > a{
  color:var(--accent-color);border-bottom:2px solid var(--accent-color);
}

/* =========================================================
   底部悬浮按钮：返回顶部 + 联系我们（与主题变量适配）
   ========================================================= */
.paper-fab-dock{
  position:fixed;z-index:950;bottom:22px;left:50%;
  transform:translateX(284px);            /* 贴齐正文右边缘（桌面） */
  display:flex;flex-direction:column;align-items:flex-end;gap:12px;
  pointer-events:none;
}
.paper-fab-dock > *{pointer-events:auto;}

/* 扁平化图标按钮：统一线性图标 + 跟随主题配色 */
.back-to-top,
.contact-fab{
  width:46px;height:46px;border:1px solid var(--border-color);border-radius:12px;
  background:var(--main-color);color:var(--accent-color);cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 14px rgba(0,0,0,.14);
  transition:transform .18s ease,background .2s ease,color .2s ease,border-color .2s ease;
}
.back-to-top .ic,
.contact-fab .ic{width:22px;height:22px;}
.back-to-top:hover,
.contact-fab:hover{
  transform:translateY(-2px);
  background:color-mix(in srgb,var(--accent-color) 12%,var(--main-color));
  border-color:var(--accent-color);
}

.contact-panel{
  position:absolute;right:0;bottom:58px;
  display:flex;flex-direction:column;gap:4px;
  background:var(--main-color);
  border:1px solid var(--header-border);
  border-radius:14px;
  padding:8px;min-width:176px;
  box-shadow:0 12px 34px rgba(0,0,0,.20);
  opacity:0;
  transform:translateY(10px) scale(.97);
  transform-origin:bottom right;
  visibility:hidden;pointer-events:none;
  transition:opacity .18s ease,transform .18s ease,visibility .18s;
}
.contact-panel.open{opacity:1;transform:none;visibility:visible;pointer-events:auto;}
.contact-item{
  display:flex;align-items:center;gap:12px;
  padding:10px 12px;border:none;background:transparent;
  color:var(--text-color);font-size:15px;font-family:inherit;
  text-align:left;width:100%;border-radius:9px;
  text-decoration:none;cursor:pointer;
  transition:background .15s ease,color .15s ease;
}
.contact-item:hover{background:var(--background-color);color:var(--accent-color);}
.contact-item .contact-ico{
  width:30px;height:30px;flex:0 0 30px;
  display:flex;align-items:center;justify-content:center;
  border-radius:8px;
  background:var(--background-color);
  color:var(--accent-color);
  transition:background .15s ease;
}
.contact-item .contact-ico .ic{width:18px;height:18px;}
.contact-item:hover .contact-ico{background:color-mix(in srgb,var(--accent-color) 16%,transparent);}
.contact-item--disabled{opacity:.45;cursor:not-allowed;}
.contact-item--disabled:hover{background:transparent;color:var(--text-color);}
.contact-item--disabled .contact-ico{background:var(--border-color);color:var(--gray-color);}

.back-to-top[hidden],
.qr-modal[hidden]{display:none !important;}

/* 文章列表：短内容全文展开 / 长内容摘要 + 阅读全文 */
.post-excerpt{
  margin:0 0 12px;color:var(--text-color);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;
}
.read-more{
  display:inline-block;color:var(--accent-color);font-size:.92em;font-weight:600;
  text-decoration:none;
}
.read-more:hover{opacity:.75;}

/* =========================================================
   二维码弹层
   ========================================================= */
.qr-modal{
  position:fixed;inset:0;z-index:999;
  background:rgba(0,0,0,.5);
  display:flex;align-items:center;justify-content:center;
  padding:20px;
}
.qr-modal-card{
  position:relative;background:var(--main-color);
  border-radius:12px;padding:24px;max-width:320px;width:100%;
  text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.3);
}
.qr-modal-close{
  position:absolute;top:8px;right:12px;border:none;background:transparent;
  font-size:24px;line-height:1;color:var(--gray-color);cursor:pointer;
}
.qr-modal-title{margin:0 0 16px;color:var(--heading-color);font-size:1.1em;}
.qr-modal-body img{width:220px;height:220px;max-width:100%;border-radius:8px;}
.qr-modal-tip{color:var(--gray-color);font-size:14px;line-height:1.7;margin:0;}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width:680px){
  body{font-size:16px;padding:14px;}
  .site-header-inner{padding:6px var(--gutter);gap:4px;}
  .ma-menu{justify-content:flex-start;}
  /* 移动端菜单左对齐，与站点名同起点，视觉更整齐 */
  .ma-menu-list{justify-content:flex-start;}
  .site-logo{min-width:0;overflow:hidden;text-overflow:ellipsis;}
  .ma-search{margin-left:auto;}
  /* 悬浮按钮：移动端改为贴屏幕右下角，避免与正文重叠 */
  .paper-fab-dock{left:auto;right:16px;transform:none;bottom:16px;}
  .back-to-top,.contact-fab{width:44px;height:44px;}
  .contact-panel{right:0;bottom:56px;}
}

/* =========================================================
   配色方案（自定义 → 主题外观 中切换）
   scheme 类挂在 <body> 上，优先级高于 :root，可覆盖自动暗色
   ========================================================= */
.scheme-blackred{ /* 黑红 */
  --background-color:#14110f;
  --main-color:#1d1a17;
  --heading-color:#f3ece8;
  --nav-color:#b59a93;
  --text-color:#e8e0dc;
  --link-color:#e8534e;
  --accent-color:#e8534e;
  --code-background-color:#000;
  --code-color:#ddd;
  --border-color:#3a2f2c;
  --blockquote-color:#e8d9d6;
  --gray-color:#8a726c;
  --shadow-color:#000;
  --header-bg:#16130f;
  --header-border:#2c2420;
}
.scheme-notes{ /* 苹果备忘录 */
  --background-color:#f1e7cb;
  --main-color:#fdf6d8;
  --heading-color:#2a2415;
  --nav-color:#8a7d5a;
  --text-color:#3a3320;
  --link-color:#b9842a;
  --accent-color:#d99e2b;
  --code-background-color:#f0e6c8;
  --code-color:#5a4a22;
  --border-color:#e3d29a;
  --blockquote-color:#7a6a3a;
  --gray-color:#a99b6f;
  --shadow-color:#e6d9ad;
  --header-bg:#f7efce;
  --header-border:#e3d29a;
}
.scheme-paper{ /* 黑白纸张阅读 */
  --background-color:#f4f4f2;
  --main-color:#ffffff;
  --heading-color:#111111;
  --nav-color:#6b6b6b;
  --text-color:#1c1c1c;
  --link-color:#1c1c1c;
  --accent-color:#1c1c1c;
  --code-background-color:#eeeeee;
  --code-color:#222;
  --border-color:#e2e2e2;
  --blockquote-color:#444;
  --gray-color:#9a9a9a;
  --shadow-color:#e6e6e6;
  --header-bg:#ffffff;
  --header-border:#e6e6e6;
}
.scheme-dark{ /* 静思蓝暗黑（原主题暗色） */
  --background-color:#0b0c1b;
  --main-color:#0e1028;
  --heading-color:#c2cef0;
  --nav-color:#585c90;
  --text-color:#aeb9d6;
  --link-color:#8aa0ff;
  --accent-color:#8aa0ff;
  --code-background-color:#000;
  --code-color:#ddd;
  --border-color:#7b88c8;
  --blockquote-color:#ccc;
  --gray-color:#4f5287;
  --shadow-color:#000;
  --header-bg:#0c0e20;
  --header-border:#23264a;
}

/* =========================================================
   文章内导航与关联（上一篇 / 下一篇 + 相关文章）
   全部引用现有 CSS 变量，适配暗色与 5 套配色
   ========================================================= */

/* 覆盖主题对 nav a 的默认 margin，避免网格/导航错位 */
.paper-post-nav a,
.paper-related a{
  margin-right:0;
}

/* —— 模块 A：上一篇 / 下一篇 —— */
.paper-post-nav{
  display:flex;
  align-items:stretch;
  gap:16px;
  margin-top:30px;
  padding-top:24px;
  border-top:1px dashed var(--gray-color);
}
.paper-post-nav__prev,
.paper-post-nav__next{
  flex:1 1 0;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  padding:14px 16px;
  background:var(--main-color);
  border:1px solid var(--border-color);
  border-radius:var(--radius);
  color:var(--text-color);
  text-decoration:none;
  transition:border-color .15s ease,color .15s ease,transform .15s ease;
}
.paper-post-nav__prev{ text-align:left; margin-right:auto; }   /* 缺失对侧时保持方位 */
.paper-post-nav__next{ text-align:right; margin-left:auto; }
.paper-post-nav__dir{
  font-size:.82em;
  color:var(--accent-color);
  font-weight:600;
}
.paper-post-nav__title{
  font-size:1em;
  line-height:1.4;
  color:var(--heading-color);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.paper-post-nav__prev:hover,
.paper-post-nav__next:hover{
  border-color:var(--accent-color);
  color:var(--accent-color);
  opacity:1;
}

/* —— 模块 B：相关文章（纯标题卡，无缩略图） —— */
.paper-related{
  margin-top:30px;
  padding-top:24px;
  border-top:1px dashed var(--gray-color);
}
.paper-related__title{
  margin:0 0 16px;
  font-size:1.15em;
  font-weight:700;
  color:var(--heading-color);
}
.paper-related__grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
}
.paper-related__item{
  display:block;
  min-width:0;
  padding:12px 14px;
  background:var(--main-color);
  border:1px solid var(--border-color);
  border-radius:var(--radius);
  color:var(--heading-color);
  font-size:.95em;
  line-height:1.45;
  text-decoration:none;
  transition:border-color .15s ease,color .15s ease,transform .15s ease;
}
.paper-related__item:hover{
  border-color:var(--accent-color);
  color:var(--accent-color);
  opacity:1;
}

/* —— 移动端：网格降为 1~2 列，导航保持两列，不横向溢出 —— */
@media (max-width:680px){
  .paper-related__grid{
    grid-template-columns:repeat(2, 1fr);
    gap:10px;
  }
  .paper-post-nav{
    gap:10px;
  }
  .paper-post-nav__prev,
  .paper-post-nav__next{
    padding:12px;
  }
}
@media (max-width:420px){
  .paper-related__grid{
    grid-template-columns:1fr;
  }
}