/*
 * Illacrimo（Typecho 复古主题）2.0
 * 外观沿用 Design Disease 的原主题：深蓝底、页头图、青色导航条、左侧浅色日期栏、中栏（蓝）与右栏（深蓝）侧边栏。
 * 布局用 CSS Grid（不再用绝对定位 + 脚本等高）；侧栏滑入用 transform（不触发重排）；侧栏粘性定位，底部圆角收尾贴住窗口底部。
 * 图标仍来自原主题的雪碧图 images/a.png。
 */

:root {
    --bg: #1a3265;
    --nav: #0097ca;
    --nav-item: #008bbe;
    --nav-hover: #005b8e;
    --side-l: #005b8e;
    --side-r: #09182a;
    --gutter: #ecf3f8;
    --link: #00a0e3;
    --link-hover: #039;
    --title: #007ac8;
    --accent: #c60;
    --muted: #8a98a2;
    --meta: #369;
    --text: #35383d;
    --dots: #888;
    --side-l-w: 320px;
    --side-r-w: 171px;
    --poke: 46px;          /* 中栏向上探进页头的高度 */
    --radius: 10px;
    --sprite: url(images/a.png);
    --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------ 基础 */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, Arial, Helvetica, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #ffd479; outline-offset: 2px; }
img { max-width: 100%; height: auto; border: 0; }
h1, h2, h3, h4 { font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif; }
hr { border: 0; border-top: 1px dotted #abb0b5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------ 整体 */
.site { padding: 0 10px; background: url(images/h.png) no-repeat center top / 100% 110px; }

/* 页头 */
.site-header {
    position: relative;
    min-height: 110px;
    padding: 27px 20px 0 30px;  /* padding: 27px 20px 0 30px; */
    background: linear-gradient(to bottom, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)), url(images/HeaderBkg.jpg) no-repeat center / cover;
    background-blend-mode: overlay;
}
.site-logo { position: absolute; top: 25px; left: 30px; width: 48px; height: 48px; background: var(--sprite) no-repeat 0 -160px; }
.site-logo:has(img) { background: none; }
.site-logo img { width: 48px; height: 48px; object-fit: contain; }
.site-title { margin: 0; font-size: 28px; line-height: 1; letter-spacing: -1px; font-weight: normal; }
.site-title a, .site-title a:hover { color: #fff; text-decoration: none; text-shadow: 0 1px 3px rgba(0, 30, 60, .6); }
/* 描述：页头中间是高亮的青色图案，原来的浅蓝字看不清；改为近白色 + 深色阴影 */
.site-desc { margin: 4px 0 0; color: #e3f4ff; font: bold 14px/16px Arial, "Microsoft YaHei", sans-serif; letter-spacing: -.3px; text-shadow: 0 1px 2px rgba(0, 25, 55, .85), 0 0 8px rgba(0, 40, 80, .45); }

/* 页头标签云：右上角，侧栏滑入后随机淡入 */
.tag-cloud {
    position: absolute;
    top: 8px;
    right: 20px;
    max-width: min(46%, 560px);
    max-height: calc(110px - var(--poke) - 14px);
    overflow: hidden;
    text-align: right;
    line-height: 1.3;
}
.tag-cloud a { display: inline-block; margin: 0 3px; font-size: var(--fs, 15px); color: var(--c, #fff); text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.tag-cloud a:hover { color: #fff; }

/* ------------------------------------------------------------ 主体网格：导航条横跨；中栏从页头探出；右栏在导航条下面 */
.site-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-l-w) var(--side-r-w);
    grid-template-rows: auto 1fr;
    overflow-x: clip;
}

.site-nav { grid-column: 1 / -1; grid-row: 1; background: var(--nav); border-radius: 4px 4px 0 0; }
.site-nav ul { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-nav .nav-menu { padding: 10px calc(var(--side-l-w) + var(--side-r-w)) 0 100px; }
.site-nav a { display: block; padding: 8px 16px; font-size: 15px; line-height: 18px; background: var(--nav-item); color: #fff; border-radius: 4px 4px 0 0; white-space: nowrap; }
.site-nav a:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.site-nav .current a { background: #fff; color: #039; font-weight: bold; }

.site-content {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    padding: 15px 20px 24px 80px;
    background: linear-gradient(to right, var(--gutter) 70px, #fff 70px);
    border-bottom-left-radius: 8px;
}

/* ------------------------------------------------------------ 侧边栏 */
.sidebar { position: relative; min-width: 0; }
.sidebar-l { grid-column: 2; grid-row: 1 / span 2; margin-top: calc(var(--poke) * -1); z-index: 2; }
.sidebar-r { grid-column: 3; grid-row: 1 / span 2; z-index: 2; }   /* 右栏顶部与蓝色导航条顶部对齐 */

/* 粘性面板：--sticky-top 由脚本按面板高度算出（比窗口高时为负值：滚到底部后底部贴住窗口；矮时为 0），
   至少一屏高，底部圆角收尾正好落在窗口底部 */
.side-panel {
    position: sticky;
    top: var(--sticky-top, 0px);
    min-height: 100vh;
    min-height: 100dvh;
    color: #fff;
}
.sidebar-l .side-panel { background: var(--side-l); border-radius: var(--radius); }
.sidebar-r .side-panel { background: var(--side-r); border-radius: var(--radius); padding: 12px 10px 15px; }

/* 中栏顶部搜索框（原 s.png 的蓝色渐变 + 白色输入框） */
.side-search { position: relative; padding: 28px 20px 14px; background: linear-gradient(#0083ca, var(--side-l)); border-radius: var(--radius) var(--radius) 0 0; }
.side-search input, .nav-search input {
    width: 100%;
    height: 26px;
    padding: 3px 38px 3px 8px;
    border: 0;
    border-radius: 4px;
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
    color: #333;
    font-size: 14px;
}
.side-search input::placeholder, .nav-search input::placeholder { color: #a9b6bf; }
.side-search input::-webkit-search-cancel-button, .nav-search input::-webkit-search-cancel-button { display: none; }

/* 导航里的分类与搜索：只在窄屏显示 */
/* 宽屏：导航只有首页与独立页面（分类在侧栏里）；窄屏的搜索框、菜单按钮不显示 */
.site-nav .nav-cat, .nav-search, .nav-toggle { display: none; }
.nav-search { position: relative; }
.side-search button, .nav-search button {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 100%;
    border: 0;
    padding: 0;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    background: var(--nav) var(--icon-search) no-repeat center / 15px;
    transition: background-color .2s;
}
.side-search button:hover, .nav-search button:hover { background-color: var(--nav-hover); }
.side-search { --h: 26px; }
.side-search button { top: 28px; right: 20px; height: var(--h); }

.side-inner { padding: 6px 20px 20px; }

/* 订阅 */
.syn { margin-bottom: 18px; padding: 10px; background: var(--side-r); border-radius: 6px 0 6px 6px; }
.syn ul { margin: 0; padding: 0; list-style: none; }
.syn li { margin: 3px 0; padding-left: 20px; color: var(--nav); background: var(--sprite) no-repeat 0 -140px; }
.syn li a { color: #fff; }
.syn .syn-readers { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.syn:hover .syn-readers, .syn:focus-within .syn-readers, .syn.open .syn-readers { max-height: 120px; }
.syn .syn-readers a { color: #9cd3ea; }

/* 小工具 */
.widget { margin-bottom: 20px; }
.widget h3 { margin: 0; padding-left: 20px; font-size: 14px; color: #ffc; background: var(--sprite) no-repeat 0 -80px; }
.widget ul { margin: 6px 0 0; padding: 8px 0 0; list-style: none; border-top: 1px dotted rgba(168, 201, 212, .7); }
.widget li { padding: 2px 0 4px 15px; color: var(--link); font-size: 13px; font-weight: bold; background: var(--sprite) no-repeat 0 -360px; }
.widget li a { display: block; color: #fff; font-size: 14px; font-weight: normal; }
/* 侧栏的文章标题、评论内容只占一行，超出部分省略号隐藏（鼠标悬停看完整内容） */
.widget li a, .recent-comments .rc-author { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.widget li a:hover { color: #abcee1; }
.widget li ul { margin: 2px 0 0; padding: 0; border-top: 0; }   /* 子分类（Typecho 嵌套的 ul.widget-list） */
.widget li li { padding-left: 15px; }
.recent-comments .rc-author { display: block; color: #9fb6c9; font-size: 12px; font-weight: normal; }
.recent-comments a { color: #ffc; }

/* 联系方式（原 QQ / MSN 图标位置） */
.contact h3 { background-position: 0 -100px; }
.contact-icons { display: flex; justify-content: space-between; padding: 10px 20px 0; }
.contact-icons > * { display: block; width: 50px; height: 100px; background: var(--sprite) no-repeat 0 -208px; }
.contact-icons .contact-mail { background-position: -50px -208px; }

/* 右栏 */
.sidebar-r .widget h3 { margin: 10px 0 5px; padding: 0 0 7px; color: #abcee1; background: none; border-bottom: 1px dotted rgba(168, 201, 212, .6); }
.sidebar-r .widget ul { border-top: 0; padding-top: 0; margin-top: 0; }
.sidebar-r .widget li { margin: 5px 0; padding: 0 0 0 8px; font-weight: normal; color: #7a8fa4; background: var(--sprite) no-repeat 0 -310px; }
.sidebar-r .widget li a { color: darkgray; }
.sidebar-r .widget li a:hover { color: #abcee1; }

/* ------------------------------------------------------------ 文章 */
.archive-title { margin: 0 0 20px; padding-bottom: 8px; font-size: 16px; font-weight: bold; color: var(--accent); border-bottom: 1px dotted #abb0b5; }
.empty-tip h2 { margin: 0 0 8px; font-size: 18px; color: var(--accent); }

.post { position: relative; margin-bottom: 40px; }
.post-single { margin-bottom: 0; }   /* 文章 / 页面：底部紧接上一篇 / 下一篇与评论，不留大段空白 */
.post-head { position: relative; padding-bottom: 12px; }
.post-title { margin: 0 0 3px; padding-bottom: 5px; font: bold 18px/1.35 Verdana, "Microsoft YaHei", Arial, sans-serif; letter-spacing: -.5px; color: var(--accent); border-bottom: 1px dotted var(--dots); }
.post-title a { color: var(--title); }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post-meta { margin: 0; font-size: 11px; font-weight: bold; color: var(--muted); }

/* 日历式日期徽章：左侧浅色栏里 */
.bak_post-date { position: absolute; top: 4px; left: -75px; width: 52px; text-align: center; color: var(--muted); font-size: 10px; font-weight: bold; line-height: 1.3; }
.bak_post-date span { display: block; }
.bak_post-date .pd-day { font: normal 24px/24px Arial, sans-serif; letter-spacing: -1px; color: #4a5a65; }
.bak_post-date .pd-month { padding-bottom: 2px; border-bottom: 1px dotted var(--dots); font-size: 10px; }

.post-date {
    position: absolute;
    top: 4px;
    left: -75px;
    width: 52px;
    display: flex;
    flex-direction: column;
    text-align: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    color: #333;
    line-height: 1;
}

.post-date .pd-month {
    order: 1;
    background: #d9534f;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 0;
}

.post-date .pd-day {
    order: 2;
    font-size: 28px;
    font-weight: 700;
    padding: 7px 0 3px;
}

.post-date .pd-year {
    border-top: 1px solid #ddd;
    order: 3;
    font-size: 13px;
    color: #888;
    padding: 2px 0 6px;
}


.post-content { font-size: 14px; line-height: 1.75; overflow-wrap: break-word; }
.post-content p {margin: 10px 8px; }
.post-content p.is-multiline { text-indent: 2em;}

.post-content h1, .post-content h2, .post-content h3, .post-content h4 { margin: 18px 8px 8px; color: var(--accent); line-height: 1.4; }
.post-content h1 { font-size: 18px; }
.post-content h2 { font-size: 16px; }
.post-content h3, .post-content h4 { font-size: 15px; }
.post-content ul { margin: 8px 0; padding: 0; list-style: none; }
.post-content ul li { margin-left: 5px; padding: 2px 0 2px 15px; color: #4c4c4c; background: var(--sprite) no-repeat 0 -1020px; }
.post-content ol { margin: 8px 8px 8px 28px; padding: 0; }
/* 引用：浅蓝卡片 + 左侧色条 + 引号 */
.post-content blockquote {
    position: relative;
    margin: 14px 8px;
    padding: 12px 16px 12px 44px;
    background: linear-gradient(to right, #eef7fc, #f7fbfd);
    border-left: 4px solid var(--nav);
    border-radius: 0 8px 8px 0;
    color: #3b5566;
}
.post-content blockquote::before {
    content: "\201C";
    position: absolute;
    top: 2px;
    left: 12px;
    font: bold 36px/1 Georgia, serif;
    color: rgba(0, 151, 202, .35);
}
.post-content blockquote p { margin: 4px 0; }
.post-content blockquote > :first-child { margin-top: 0; }
.post-content blockquote > :last-child { margin-bottom: 0; }

/* 代码块：深色圆角卡片，横向滚动不换行 */
.post-content pre {
    margin: 14px 8px;
    padding: 14px 16px;
    overflow-x: auto;
    background: #22344a;
    color: #e4eef6;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 2px 6px rgba(9, 24, 42, .12);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre;
    tab-size: 4;
    scrollbar-width: thin;
    scrollbar-color: #4b6a8c transparent;
}
.post-content pre code { padding: 0; background: none; color: inherit; font-size: inherit; white-space: inherit; }
.post-content code { font-family: "JetBrains Mono", "Cascadia Code", Consolas, Menlo, "Courier New", monospace; font-size: 13px; }
/* 标题紧跟代码块 / 引用时（h3 + pre、h3 + blockquote）：标题变成该块的标题栏，与下面的块连成一体 */
.post-content :is(h2, h3, h4):has(+ pre),
.post-content :is(h2, h3, h4):has(+ blockquote) {
    margin-bottom: 0;
    padding: 7px 14px;
    font-size: 16px;
    line-height: 1.5;
}
.post-content :is(h2, h3, h4):has(+ pre) {
    background: #2d4460;
    color: #d3e6f4;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.post-content :is(h2, h3, h4) + pre { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.post-content :is(h2, h3, h4):has(+ blockquote) {
    background: #dcedf7;
    color: #1f5f80;
    border-left: 4px solid var(--nav);
    border-radius: 0 8px 0 0;
}
.post-content :is(h2, h3, h4) + blockquote { margin-top: 0; border-top-right-radius: 0; }

/* 行内代码：浅色胶囊 */
.post-content :not(pre) > code { padding: 2px 6px; background: #eef3f7; border: 1px solid #dde6ec; border-radius: 4px; color: #c7254e; font-size: .9em; }
.post-content img { display: block; margin: 10px auto; }
.post-content table { margin: 10px 8px; border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; }
.post-content th, .post-content td { padding: 4px 8px; border: 1px solid #dde6ec; }

.post-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 6px; border-top: 1px dotted var(--dots); color: var(--meta);  font-weight: bold; line-height: 22px; }
.post-foot span { padding-left: 18px; background: var(--sprite) no-repeat 0 -34px; }
.post-foot .pf-com { background-position: 0 -14px; }
.post-foot a { text-decoration: underline; }

.post-near { margin: 12px 0 0; padding: 8px 0; border-top: 1px dotted #dde6ec; border-bottom: 1px dotted #dde6ec; color: #999;  }
.post-near p { margin: 2px 0; }

/* 分页（Typecho 的 ol.page-navigator） */
.page-navigator { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 20px; padding: 0; list-style: none; }
.page-navigator a, .page-navigator span { display: inline-block; padding: 5px 14px; border-radius: 6px; }
.page-navigator a { background: #f3f7fa; border: 1px solid transparent; color: #007bff; transition: background .2s, border-color .2s; }
.page-navigator a:hover { background: #e7f3ff; border-color: #007bff; text-decoration: none; }
.page-navigator .current a { background: #007bff; border-color: #007bff; color: #fff; font-weight: bold; }
.page-navigator span { color: #666; }

/* ------------------------------------------------------------ 表单与按钮 */
.text, .textarea, .inline-search input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #9dc0d0;
    border-radius: 3px;
    background: #f5fdff;
    color: #282b31;
    font: inherit;
}
.text:focus, .textarea:focus { border-color: var(--nav); background: #fff; outline: none; }
.btn { padding: 6px 16px; border: 0; border-radius: 3px; background: var(--nav); color: #fff; font: inherit; cursor: pointer; }
.btn:hover { background: var(--nav-hover); }
/* 404 等页面里的搜索框：输入框与按钮同高（38px），连成一体 */
.inline-search { display: flex; align-items: stretch; max-width: 420px; margin: 12px 8px; }
.inline-search input { flex: 1; min-width: 0; height: 38px; margin: 0; border-right: 0; border-radius: 4px 0 0 4px; line-height: 1.2; }
.inline-search input::-webkit-search-cancel-button { display: none; }
.inline-search .btn { flex: none; height: 38px; margin: 0; padding: 0 18px 0 36px; border-radius: 0 4px 4px 0; line-height: 1; background: var(--nav) var(--icon-search) no-repeat 14px center / 14px; }
.inline-search .btn:hover { background-color: var(--nav-hover); }
.muted { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------ 评论 */
#comments { padding-top: 4px; }
#comments h3, .respond h3 { margin: 14px 0 8px; font-size: 16px; color: var(--accent); }
#comment-form p { margin: 0 0 10px; }
.comment-list, .comment-list ol { margin: 0; padding: 0; list-style: none; }
.comment-list li { margin-top: 10px; padding: 14px; border: 1px solid var(--dots); border-radius:6px; }
.comment-list li.comment-level-odd { background: #f6f6f3; }
.comment-list li.comment-level-even { background: #fff; }
.comment-list li.comment-by-author { background: #fff9e8; }
.comment-list li .comment-reply { font-size: 1rem; }
.comment-meta a { color: #999; font-size: .93em; }
.comment-author { display: block; margin-bottom: 3px; color: #444; }
.comment-author .avatar { float: left; margin-right: 10px; border-radius: 3px; }
.comment-author cite { font-weight: bold; font-style: normal; }
.comment-list .respond { 
    background: #bbe9ff;
    margin: 15px 0 0;
    padding: 15px;
border-radius: 6px;
}

.respond { 
    background: #bbe9ff;
    margin: 15px 0 0;
    padding: 15px;
border-radius: 6px;
}

.respond .cancel-comment-reply { float: right; margin-top: 15px; font-size: .93em; }
.comment-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
#comment-form label { display: block; margin-bottom: .4em; font-weight: bold; }
#comment-form .required::after { content: " (*)"; color: #c00; }
#comment-form textarea {max-width: 640px;}

/* ------------------------------------------------------------ 页脚 */
.site-footer { padding: 12px 15px 18px; color: #92b8cd; font-size: 13px; }
.site-footer p { margin: 0 0 2px; }
.site-footer a { color: #92b8cd; text-decoration: underline; }
.site-footer a:hover { color: #fff; }
.footer-extra { margin-top: 6px; font-size: 12px; }

/* ------------------------------------------------------------ 动效
 * 侧栏滑入、标签云淡入都用 CSS 关键帧动画：页面一渲染就播放，结束状态永远是“显示”，
 * 不依赖脚本（脚本加载慢 / 被拦截 / 页面卡顿时侧栏也不会缺失），transform / opacity 在合成层运行不卡主线程。
 * 离开页面时脚本加 html.sb-out 反向滑出；没有跳转成功时脚本会去掉它恢复显示。 */
@keyframes il-slide-in { from { transform: translateX(var(--sb-from)); } to { transform: none; } }
@keyframes il-slide-out { from { transform: none; } to { transform: translateX(var(--sb-from)); } }
@keyframes il-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes il-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes il-menu-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.sidebar-r .side-panel { --sb-from: calc(100% + 30px); animation: il-slide-in .5s cubic-bezier(.2, .8, .3, 1) both; }
.sidebar-l .side-panel { --sb-from: calc(100% + var(--side-r-w) + 40px); animation: il-slide-in .6s cubic-bezier(.2, .8, .3, 1) .2s both; }
.tag-cloud a { animation: il-fade-in .4s ease-out calc(650ms + var(--d, 0ms)) both; }

html.sb-out .sidebar-l .side-panel { animation: il-slide-out .4s ease-in both; }
html.sb-out .sidebar-r .side-panel { animation: il-slide-out .35s ease-in .2s both; }
html.sb-out .tag-cloud a { animation: il-fade-out .25s ease-in calc(var(--d, 0ms) / 4) both; }

@media (prefers-reduced-motion: reduce) {
    .side-panel, .tag-cloud a, html.sb-out .side-panel, html.sb-out .tag-cloud a { animation: none !important; }
    .syn .syn-readers { transition: none; }
}

/* ------------------------------------------------------------ 窄屏 */
@media (max-width: 1100px) {
    :root { --side-l-w: 280px; --side-r-w: 160px; }
    .side-inner { padding: 6px 16px 18px; }
}

/* 平板：侧栏移到内容下面（两栏并排），不粘性、不滑动 */
@media (max-width: 900px) {
    .tag-cloud { display: none; }
    .site-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto; }
    .site-nav { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 8px 10px 0; }
    .site-nav .nav-menu { flex: 1 1 auto; min-width: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
    .site-nav .nav-menu::-webkit-scrollbar { display: none; }
    .site-nav .nav-cat { display: block; }
    .site-nav .nav-cat a { background: rgba(0, 91, 142, .55); }
    .nav-search { display: block; flex: 0 1 240px; margin-bottom: 6px; }
    .side-search { display: none; }
    .sidebar-l .side-inner { padding-top: 16px; }
    .site-content { grid-column: 1 / -1; border-radius: 0 0 8px 8px; }
    .sidebar-l, .sidebar-r { grid-row: 3; margin-top: 14px; }
    .sidebar-l { grid-column: 1; margin-right: 7px; }
    .sidebar-r { grid-column: 2; margin-left: 7px; }
    .sidebar .side-panel, html.sb-out .sidebar .side-panel { position: static; min-height: 0; height: 100%; animation: none; }
    .sidebar-r .side-panel { border-radius: var(--radius); }
}

/* 手机：单栏、去掉两边的深色边；导航条只有搜索框；右上角菜单按钮弹开导航（首页 → 分类 → 页面） */
@media (max-width: 600px) {
    .site { padding: 0; }
    .site-header { padding: 22px 60px 14px 76px; }
    .site-logo { left: 16px; top: 20px; }
    .site-title { font-size: 24px; }
    .site-nav { border-radius: 0; padding: 8px 10px; }
    .site-content { padding: 15px 14px 20px; background: #fff; border-radius: 0; }
    .site-footer { padding: 12px 14px 18px; }
    .post-date { position: static; display: flex; gap: 4px; align-items: baseline; width: auto; margin-top: 4px; text-align: left; }
    .post-date span { display: inline; }
    .post-date .pd-day { font-size: 16px; line-height: 1; }
    .post-date .pd-month { border: 0; padding: 0; }
    .sidebar-l, .sidebar-r { display: none; }
    .comment-fields { grid-template-columns: minmax(0, 1fr); }
    .post-content :is(p, blockquote, pre, h1, h2, h3, h4) { margin-left: 0; margin-right: 0; }

    /* 导航条：搜索框占满；菜单默认收起 */
    .nav-search { flex: 1 1 100%; margin: 0; }
    .site-nav .nav-menu { display: none; }
    /* 弹开的菜单：固定在右上角按钮下面的独立浮层（不占位置；滚动到哪里打开都在屏幕上） */
    html.menu-open .site-nav .nav-menu {
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + 58px);
        left: 8px;
        right: 8px;
        z-index: 40;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        max-height: calc(100vh - 80px);
        max-height: calc(100dvh - 80px);
        overflow-y: auto;
        padding: 12px 10px 14px;
        background: rgba(0, 120, 168, .97);
        border: 1px solid rgba(255, 255, 255, .25);
        border-radius: 10px;
        box-shadow: 0 12px 28px rgba(5, 20, 45, .5);
        animation: il-menu-drop .18s ease-out;
    }
    .site-nav .nav-menu a { border-radius: 4px; padding: 7px 14px; }

    /* 右上角菜单按钮：三条横杠，弹开时变成 ×；固定在屏幕右上角，滚动时一直浮在那里 */
    .nav-toggle {
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + 12px);
        right: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 36px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, .35);
        border-radius: 8px;
        background: rgba(0, 91, 142, .92);
        box-shadow: 0 3px 10px rgba(5, 20, 45, .35);
        cursor: pointer;
        z-index: 41;
    }
    .nav-toggle:hover, html.menu-open .nav-toggle { background: var(--side-r); }
    .nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 1px;
        background: #fff;
        transition: transform .2s, background-color .2s;
    }
    .nav-toggle-icon { position: relative; }
    .nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-icon::before { top: -6px; }
    .nav-toggle-icon::after { top: 6px; }
    html.menu-open .nav-toggle-icon { background: transparent; }
    html.menu-open .nav-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
    html.menu-open .nav-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }
}

/* ------------------------------------------------------------ 归档页面（page-archives.php） */
.archives-page .post-head { margin-bottom: 10px; }
.archive-years { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 8px 18px; }
.archive-years a { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--gutter); color: var(--title); font-weight: bold; font-size: 13px; }
.archive-years a:hover { background: var(--nav); color: #fff; text-decoration: none; }
.archive-years small { color: var(--muted); font-weight: normal; font-size: 11px; }
.archive-years a:hover small { color: #dff3fb; }

.archive-year { margin: 0 8px 16px; border: 1px solid #dde6ec; border-radius: 8px; overflow: hidden; }
.archive-year > summary { display: flex; align-items: baseline; gap: 10px; padding: 8px 14px; cursor: pointer; list-style: none; background: linear-gradient(to right, #eef7fc, #f7fbfd); border-left: 4px solid var(--nav); }
.archive-year > summary::-webkit-details-marker { display: none; }
.archive-year > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
.archive-year:not([open]) > summary::after { transform: rotate(-90deg); }
.ay-year { font: bold 20px/1.2 "Trebuchet MS", Arial, sans-serif; color: var(--accent); }
.ay-count { color: var(--muted); font-size: 12px; }

.archive-month { padding: 4px 14px 8px; }
.archive-month + .archive-month { border-top: 1px dotted #dde6ec; }
.archive-month h2 { margin: 8px 0 4px; font-size: 14px; color: var(--meta); }
.archive-month h2 span { color: var(--muted); font-size: 12px; font-weight: normal; }
.archive-month ul { margin: 0; padding: 0; list-style: none; }
.archive-month li { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; }
.archive-month time { flex: none; width: 3.4em; color: var(--muted); font: 12px/1.6 Consolas, Menlo, monospace; }
.archive-month li a { flex: 1; min-width: 0; color: var(--title); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.am-com { flex: none; padding: 0 6px; border-radius: 999px; background: #eef3f7; color: var(--muted); font-size: 11px; line-height: 18px; }

@media (max-width: 600px) {
    .archive-years, .archive-year { margin-left: 0; margin-right: 0; }
}

/* ------------------------------------------------------------ 标签云页面（page-tags.php） */
.tags-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 6px 8px 14px; }
.tags-toolbar .tags-filter { flex: 0 1 240px; padding: 5px 10px; }
.tags-sort { display: inline-flex; border: 1px solid #9dc0d0; border-radius: 4px; overflow: hidden; }
.tags-sort button { padding: 5px 12px; border: 0; background: #f5fdff; color: var(--meta); font: inherit; font-size: 13px; cursor: pointer; }
.tags-sort button + button { border-left: 1px solid #9dc0d0; }
.tags-sort button.on { background: var(--nav); color: #fff; }
.tags-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 8px; padding: 0; list-style: none; }
.tags-list li[hidden] { display: none; }
.tags-list a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border: 1px solid #cfe3ee;
    border-radius: 999px;
    background: #f3f9fc;
    color: var(--title);
    line-height: 1.3;
    transition: background .15s, border-color .15s, color .15s;
}
.tags-list a span { min-width: 22px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--muted); font-size: 11px; line-height: 18px; text-align: center; }
.tags-list a:hover { background: var(--nav); border-color: var(--nav); color: #fff; text-decoration: none; }
.tags-list a:hover span { color: var(--nav); }
.tags-list .tag-w0 { font-size: 13px; }
.tags-list .tag-w1 { font-size: 14px; }
.tags-list .tag-w2 { font-size: 15px; background: #e8f4fa; }
.tags-list .tag-w3 { font-size: 17px; background: #dceef7; border-color: #b9d9e8; }
.tags-list .tag-w4 { font-size: 19px; background: #d0e8f4; border-color: #9fcbe0; font-weight: bold; }
.tags-none { margin: 10px 8px; }
@media (max-width: 600px) {
    .tags-toolbar, .tags-list { margin-left: 0; margin-right: 0; }
    .tags-toolbar .tags-filter { flex-basis: 100%; }
}
