/*
Theme Name: 2012 双栏文字主题（Typecho 版）
Based on: WordPress Twenty Twelve / huhexian 2012-huhexian
Description: 960px 居中双栏文字博客主题，带暗黑模式、打字机副标题、图片灯箱、回到顶部
*/

/* ========== 变量 ========== */
:root {
    --bg: #e6e6e6;
    --site-bg: #ffffff;
    --text: #444444;
    --muted: #757575;
    --border: #ededed;
    --link: #21759b;
    --link-hover: #0f3647;
    --post-title: #0066a6;
    --accent: #21759b;
    --heading-bg: #f6f6f6;
    --quote-bg: #f7f7f7;
    --code-bg: #f6f6f6;
    --nav-text: #5e5e5e;
    --site-title: #515151;
    --shadow: 0 2px 6px rgba(100, 100, 100, .3);
    --scrollbar: #c4d8e2;
    --scrollbar-hover: #add8e6;
}

html[data-theme="dark"] {
    --bg: #111111;
    --site-bg: #181818;
    --text: #a6a6a6;
    --muted: #7a7a7a;
    --border: #2e2e2e;
    --link: #6fa8c9;
    --link-hover: #d3d3d3;
    --post-title: #7ab3d0;
    --accent: #21759b;
    --heading-bg: #202020;
    --quote-bg: #1f1f1f;
    --code-bg: #202020;
    --nav-text: #8a8a8a;
    --site-title: #d3d3d3;
    --shadow: 0 2px 6px rgba(0, 0, 0, .6);
    --scrollbar: #2c4a5c;
    --scrollbar-hover: #3d6478;
}

/* ========== 基础 ========== */
html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    background: var(--site-bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
        "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
    font-size: 18px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    word-wrap: break-word;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--link-hover);
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
}

ul,
ol {
    padding-left: 1.5em;
}

/* 大屏灰底 + 白色卡片 */
@media screen and (min-width: 1080px) {
    body {
        background: var(--bg);
        padding: 30px 40px;
    }

    .site {
        padding: 0 40px;
        box-shadow: var(--shadow);
    }
}

/* ========== 整体布局 ========== */
.site {
    max-width: 960px;
    margin: 0 auto;
    background: var(--site-bg);
    padding: 0 24px;
}

.wrapper {
    overflow: hidden;
    zoom: 1;
}

#primary {
    float: left;
    width: 66.67%;
    padding-right: 4%;
}

#secondary {
    float: right;
    width: 26.67%;
    word-break: break-word;
}

/* ========== 页头 ========== */
.site-header {
    position: relative;
    padding: 24px 0 14px;
    text-align: center;
}

.site-title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.29;
}

.site-title a {
    color: var(--site-title);
}

.site-title a:hover {
    color: var(--link);
}

/* 印章 Logo：页头右上角，点击回首页 */
.site-stamp {
    position: absolute;
    top: 14px;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .2s ease;
}

.site-stamp:hover {
    transform: translateY(-2px);
}

.site-stamp img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.site-description {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: normal;
    color: var(--muted);
    min-height: 22px;
}

/* 打字机光标 */
.typed-cursor {
    display: inline-block;
    width: 2px;
    height: 15px;
    margin-left: 3px;
    vertical-align: -2px;
    background: #fe5186;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========== 导航 ========== */
.main-navigation {
    margin-top: 18px;
    margin-bottom: 24px;
    text-align: center;
}

.main-navigation ul.nav-menu {
    display: block;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.main-navigation li {
    display: inline-block;
    margin-right: 32px;
    font-size: 17px;
    font-weight: 700;
    line-height: 2.5;
}

.main-navigation a {
    color: var(--nav-text);
    font-weight: 700;
    padding: 4px 0;
}

/* 二级分类下拉：默认隐藏，悬停一级分类时下滑展开 */
.main-navigation .menu-item-has-children {
    position: relative;
}

.main-navigation .sub-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 8px);
    min-width: 120px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--heading-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 99;
}

.main-navigation .menu-item-has-children:hover .sub-menu,
.main-navigation .menu-item-has-children:focus-within .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.main-navigation .sub-menu li {
    display: block;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    white-space: nowrap;
}

.main-navigation .sub-menu a {
    display: block;
    padding: 7px 16px;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: var(--link);
}

.main-navigation li:last-child {
    margin-right: 0;
}


.menu-toggle {
    display: none;
}

/* ========== 悬浮 Logo（页面右侧顶部） ========== */
/* ========== 右侧悬浮工具栏 ========== */
.side-toolbar {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 95;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.st-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--site-bg);
    color: var(--text);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    transition: color .2s ease, border-color .2s ease, transform .2s ease;
}

.st-btn:hover {
    color: var(--link);
    border-color: var(--link);
    transform: translateY(-2px);
}

@media screen and (max-width: 600px) {
    .side-toolbar {
        right: 12px;
        bottom: 60px;
    }

    .st-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

/* ========== 文章 ========== */
.post {
    margin-bottom: 12px;
    padding-bottom: 12px;
}

/* 文章列表之间的装饰分隔符（线 + 中心花饰，仅相邻文章之间） */
.post + .post::before {
    content: "❋";
    display: block;
    height: 14px;
    line-height: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin: 26px 0 30px;
    background: linear-gradient(to right,
        var(--border) 0, var(--border) 44%,
        transparent 44%, transparent 56%,
        var(--border) 56%, var(--border) 100%) left center / 100% 1px no-repeat;
}

.entry-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.7;
}

.entry-title a {
    color: var(--post-title);
}

.entry-title a:hover {
    color: var(--link-hover);
}

.entry-meta {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 18px;
}

.entry-meta a {
    color: var(--muted);
}

.entry-meta a:hover {
    color: var(--link);
}

.entry-summary {
    font-size: 16px;
    line-height: 1.714285714;
    color: var(--text);
}

.entry-summary p {
    margin: 0 0 12px;
}

.entry-footer {
    margin-top: 14px;
    font-size: 13px;
}

.more-link {
    display: inline-block;
    color: var(--link);
    margin-right: 16px;
}

.more-link:hover {
    color: var(--link-hover);
}

.comments-link a {
    color: var(--muted);
}

.comments-link a:hover {
    color: var(--link);
}

/* 文章底部信息行：◎发布 / ◎浏览 / ◎标签 */
.entry-footer-meta {
    clear: both;
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
}

.entry-footer-meta span {
    display: inline-block;
    margin-right: 14px;
    white-space: nowrap;
}

.entry-footer-meta .meta-tags {
    white-space: normal;
    margin-right: 0;
}

.entry-footer-meta a {
    color: var(--muted);
}

.entry-footer-meta a:hover {
    color: var(--link);
}

/* ========== 文章内容排版（含 h2/h3 自动编号） ========== */
.entry-content {
    font-size: 16px;
    line-height: 1.8;
}

.entry-content p {
    margin: 0 0 1.2em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    font-weight: bold;
    line-height: 1.6;
    margin: 1.6em 0 .8em;
}

.entry-content {
    counter-reset: h2-counter;
}

.entry-content h2 {
    counter-reset: h3-counter;
    font-size: 18px;
    background: var(--heading-bg);
    border-left: 5px solid #21759b;
    padding: 6px 12px;
}

.entry-content h2::before {
    counter-increment: h2-counter;
    content: counter(h2-counter) ". ";
    color: var(--link);
}

.entry-content h3 {
    counter-reset: h4-counter;
    font-size: 16px;
    background: var(--heading-bg);
    border-left: 5px solid #53a7dc;
    padding: 5px 12px;
}

.entry-content h3::before {
    counter-increment: h3-counter;
    content: counter(h2-counter) "." counter(h3-counter) " ";
    color: #53a7dc;
}

.entry-content h4 {
    font-size: 15px;
}

.entry-content h4::before {
    counter-increment: h4-counter;
    content: counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) " ";
    color: #53a7dc;
}

.entry-content blockquote {
    margin: 1.5em 0;
    padding: 12px 20px;
    background: var(--quote-bg);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    color: var(--muted);
}

html[data-theme="dark"] .entry-content blockquote {
    box-shadow: none;
}

.entry-content blockquote p {
    margin: 0;
}

.entry-content code {
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    font-size: .92em;
    color: #d14;
    background: var(--code-bg);
    padding: 2px 5px;
    border-radius: 3px;
}

.entry-content pre {
    background: var(--code-bg);
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: auto;
    line-height: 1.6;
}

.entry-content pre code {
    padding: 0;
    background: none;
    color: inherit;
}

.entry-content img {
    border-radius: 4px;
    cursor: zoom-in;
}

/* ========== [photos] 相册网格 ========== */
.photos-gallery {
    display: grid;
    /* 未指定列数时由 PHP 按图片数量输出对应的 photos-cols-N，不再留空格子 */
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 14px 0 22px;
}

.photos-gallery.photos-cols-1 {
    grid-template-columns: 1fr;
}

.photos-gallery.photos-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.photos-gallery.photos-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.photos-gallery.photos-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.photos-item {
    margin: 0;
    overflow: hidden;
    border-radius: 6px;
    background: var(--border);
    aspect-ratio: 4 / 3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.photos-item img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    cursor: zoom-in;
    transition: transform .35s ease;
}

.photos-item:hover img {
    transform: scale(1.05);
}

.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
}

.entry-content th,
.entry-content td {
    border: 1px solid var(--border);
    padding: 6px 10px;
}

.entry-content th {
    background: var(--heading-bg);
}

html[data-theme="dark"] .entry-content img {
    filter: brightness(.85);
}

/* 标签 */
.post-tags {
    font-size: 13px;
    color: var(--muted);
}

/* 上下篇导航 */
.post-navigation {
    overflow: hidden;
    margin-bottom: 36px;
    font-size: 13px;
}

.nav-previous {
    float: left;
    max-width: 50%;
}

.nav-next {
    float: right;
    text-align: right;
    max-width: 50%;
}

/* 归档页标题 */
.archive-header {
    margin-bottom: 32px;
}

.archive-title {
    font-size: 18px;
    font-weight: normal;
    color: var(--text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.archive-count {
    font-size: 13px;
    color: var(--muted);
}

/* ========== 分页 ========== */
.page-navigator {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    text-align: center;
}

.page-navigator li {
    display: inline-block;
    margin: 0 4px;
    font-size: 13px;
}

.page-navigator a {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: #0073aa;
    transition: all .2s ease;
}

.page-navigator a:hover {
    border-color: #0073aa;
}

.page-navigator .current a {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* ========== 侧栏 ========== */
.widget-area .widget {
    margin-bottom: 48px;
    font-size: 13px;
}

.widget-title {
    margin: 0 0 14px;
    font-size: 19px;
    font-weight: 700;
    color: #444;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    line-height: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget ul li a {
    color: var(--text);
}

.widget ul li a:hover {
    color: var(--link);
}

/* 站点公告（Markdown 渲染） */
.widget-notice .notice-content {
    padding: 10px 12px;
    background: var(--quote-bg);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
    line-height: 1.7;
}

.widget-notice .notice-content p {
    margin: 0 0 8px;
}

.widget-notice .notice-content p:last-child {
    margin-bottom: 0;
}

.widget-notice .notice-content ul,
.widget-notice .notice-content ol {
    margin: 0 0 8px;
    padding-left: 20px;
}

.widget-notice .notice-content a {
    color: var(--link);
}

.widget-notice .notice-content a:hover {
    color: var(--link-hover);
}

.widget-notice .notice-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 两栏列表（友情链接 / 分类目录 / 自定义 HTML） */
.widget-links-doublecol ul,
.widget-links ul,
.widget-categories ul,
.widget_text .doublecol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.widget-links-doublecol ul,
.widget-links ul,
.widget-categories ul {
    margin: 0;
    padding: 0;
}

.widget-links-doublecol li,
.widget-links li,
.widget-categories li,
.doublecol li {
    list-style: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 2;
}

/* 侧栏空状态提示 */
.widget .widget-empty {
    margin: 0;
    color: var(--muted);
    line-height: 2;
}

/* 蜜罐字段：对人眼不可见（移出屏幕而非 display:none，避免被机器人识别） */
.comment-form-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* 搜索框 */
.search-form {
    overflow: hidden;
}

.search-field {
    float: left;
    width: calc(100% - 54px);
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 4px 0 0 4px;
    background: var(--site-bg);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color .2s ease;
}

.search-field:focus {
    border-color: #00a0d2;
}

.search-submit {
    float: left;
    width: 50px;
    height: 36px;
    border: 0;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: opacity .2s ease;
}

.search-submit:hover {
    opacity: .88;
}

/* 标签云 */
.tagcloud {
    line-height: 2;
}

.tagcloud a {
    display: inline-block;
    margin: 0 8px 0 0;
    font-size: 13px !important;
    color: var(--text);
}

.tagcloud a:hover {
    color: var(--link);
}

/* ========== 评论 ========== */
.comments-area {
    margin-top: 12px;
}

.comments-title {
    font-size: 18px;
    font-weight: normal;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.comment-list {
    list-style: none;
    margin: 24px 0;
    padding: 0;
}

/* Typecho 会给每层嵌套回复再包一个 ol.comment-list，清掉叠加的外边距 */
.comment-list .comment-list {
    margin: 0;
}

.comment-body {
    margin: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

/* 顶层评论间距稍大，区分不同评论主线 */
.comment-list > li.comment-body {
    padding-bottom: 24px;
}

.comment-children {
    margin: 0;
    padding-left: 44px;
}

.comment-children .comment-body {
    border-bottom: 0;
}

.comment-author {
    overflow: hidden;
}

.comment-author .fn {
    font-style: normal;
    font-size: 14px;
    color: var(--post-title);
}

.comment-by-author > div > .comment-author .fn::after {
    content: "博主";
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    font-size: 11px;
    line-height: 1.6;
    color: #fff;
    background: var(--accent);
    border-radius: 3px;
    vertical-align: 1px;
}

.comment-meta {
    font-size: 12px;
    color: var(--muted);
    margin: 2px 0 8px;
}

.comment-meta a {
    color: var(--muted);
}

.comment-meta a:hover {
    color: var(--link);
}

.comment-reply a {
    margin-left: 10px;
    color: var(--link);
}

.comment-content {
    font-size: 13px;
    line-height: 2;
}

.comment-content p {
    margin: 0 0 .6em;
}

/* 评论表单 */
.respond {
    margin-top: 12px;
}

.comment-reply-title {
    font-size: 16px;
    font-weight: normal;
    color: var(--text);
}

.comment-form p {
    margin: 0 0 14px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--muted);
}

.required {
    color: #ea4335;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    max-width: 380px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--site-bg);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color .2s ease;
}

.comment-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--site-bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.8;
    outline: none;
    resize: vertical;
    transition: border-color .2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #00a0d2;
}

.comment-form .submit {
    padding: 8px 28px;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: opacity .2s ease;
}

.comment-form .submit:hover {
    opacity: .88;
}

.logged-in-as {
    font-size: 13px;
    color: var(--muted);
}

.cancel-comment-reply {
    font-size: 13px;
    margin-bottom: 6px;
}

/* ========== 页脚 ========== */
.site-footer {
    clear: both;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 12px;
    color: #686868;
}

.site-footer a {
    color: #686868;
}

.site-footer a:hover {
    color: var(--link);
}

.footer-custom {
    margin: 4px 0;
}

html[data-theme="dark"] .site-footer {
    color: #6a6a6a;
}

html[data-theme="dark"] .site-footer a {
    color: #6a6a6a;
}

/* 备案号：横排一行，中间用 · 分隔 */
.footer-icp a {
    margin: 0 4px;
}

.footer-icp-sep {
    margin: 0 4px;
}

/* ========== 回到顶部 ========== */
#back-to-top {
    position: fixed;
    right: 22px;
    bottom: 30px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #0073aa;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all .3s ease;
    z-index: 999;
}

#back-to-top.show {
    opacity: .9;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    opacity: 1;
}

/* ========== 灯箱（缩放 / 拖动 / 自动播放 / 全屏 / 缩略图导航） ========== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lb-fade .25s ease;
}

@keyframes lb-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-counter {
    position: absolute;
    top: 18px;
    left: 20px;
    color: #ccc;
    font-size: 13px;
}

.lightbox-toolbar {
    position: absolute;
    top: 10px;
    right: 12px;
    display: flex;
}

.lightbox-toolbar button,
.lightbox-prev,
.lightbox-next {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 24px;
    font-family: inherit;
    cursor: pointer;
    opacity: .7;
    transition: opacity .2s ease;
    line-height: 1;
    padding: 8px 10px;
}

.lightbox-toolbar button:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close { font-size: 30px; }
.lightbox-play, .lightbox-fullscreen { font-size: 18px; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 42px;
    text-shadow: 0 0 6px rgba(0, 0, 0, .5);
}

.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lightbox-img {
    max-width: 92%;
    max-height: 84%;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, .6);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-img.lb-anim { animation: lb-zoom .25s ease; }

.lightbox-img.zoomed { cursor: grab; }
.lightbox-img.zoomed:active { cursor: grabbing; }

@keyframes lb-zoom {
    from { transform: scale(.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-title {
    position: absolute;
    bottom: 78px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
    padding: 0 60px;
    pointer-events: none;
}

.lightbox-thumbs {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 92%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: thin;
}

.lightbox-thumb {
    height: 46px;
    min-width: 46px;
    flex: none;
    object-fit: cover;
    border-radius: 3px;
    opacity: .55;
    cursor: pointer;
    transition: opacity .2s;
}

.lightbox-thumb:hover { opacity: .85; }

.lightbox-thumb.active {
    opacity: 1;
    outline: 2px solid #fff;
}

/* 正文图片可点击放大提示（仅灯箱开启时） */
body[data-lightbox] .entry-content img { cursor: zoom-in; }

/* ========== 自定义滚动条 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--scrollbar), var(--scrollbar-hover));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #21759b;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3d6478;
}

/* ========== 响应式 ========== */
@media screen and (min-width: 600px) {
    .site-header {
        text-align: left;
    }

    .main-navigation {
        text-align: left;
    }
}

@media screen and (max-width: 1080px) {
    .site {
        padding: 0 16px;
    }
}

@media screen and (max-width: 600px) {
    #primary,
    #secondary {
        float: none;
        width: 100%;
        padding-right: 0;
    }

    .site-header {
        padding-top: 18px;
    }

    .site-stamp {
        display: none;
    }

    .site-title {
        font-size: 28px;
    }

    .entry-title {
        font-size: 23px;
    }

    .main-navigation {
        position: relative;
        margin-bottom: 18px;
    }

    .menu-toggle {
        display: block;
        width: 100%;
        padding: 8px 0;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--nav-text);
        font-size: 14px;
        cursor: pointer;
        border-radius: 4px;
    }

    .main-navigation ul.nav-menu {
        display: none;
        border: 0;
        padding: 4px 0;
    }

    .main-navigation ul.nav-menu.open {
        display: block;
    }

    .main-navigation li {
        display: block;
        margin-right: 0;
    }

    /* 移动端：二级分类静态缩进展示，不依赖悬停 */
    .main-navigation .sub-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        border: 0;
        box-shadow: none;
        background: transparent;
        padding: 0 0 4px 18px;
        min-width: 0;
    }

    .photos-gallery,
    .photos-gallery.photos-cols-3,
    .photos-gallery.photos-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .photos-gallery.photos-cols-1 {
        grid-template-columns: 1fr;
    }
}

/* ========== 归档页（自定义页面模板「归档」） ========== */
.archive-stats {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.archive-title {
    margin: 28px 0 12px;
    font-size: 16px;
    font-weight: bold;
    color: #636363;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.archive-pages {
    margin: 0;
    line-height: 2;
}

.archive-pages a,
.archive-cats a {
    color: var(--link);
    text-decoration: underline;
}

.archive-pages a:hover,
.archive-cats a:hover {
    color: var(--link-hover);
}

.archive-cats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
}

.archive-cats li {
    line-height: 2;
    white-space: nowrap;
}

.archive-cats li::before {
    content: "○";
    margin-right: 6px;
    color: var(--muted);
    font-size: 12px;
}

.archive-toggle-bar {
    margin: 0 0 16px;
}

.archive-toggle-bar button {
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--heading-bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s ease;
}

.archive-toggle-bar button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.archive-toggle-tip {
    margin-left: 8px;
    color: var(--muted);
    font-size: 12px;
}

/* 年 / 月 折叠树 */
.archive-tree details {
    margin: 0 0 4px;
}

.archive-tree summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--text);
    line-height: 2.2;
    list-style: none;
    user-select: none;
}

.archive-tree summary::-webkit-details-marker {
    display: none;
}

.archive-tree summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 6px;
    color: var(--muted);
    font-size: 12px;
    transition: transform .15s ease;
}

.archive-tree details[open] > summary::before {
    transform: rotate(90deg);
}

.archive-tree summary:hover {
    color: var(--accent);
}

.archive-tree .archive-year > summary {
    font-size: 18px;
}

.archive-tree .archive-month {
    margin: 0 0 12px 14px;
}

.archive-tree .archive-month > summary {
    font-size: 14px;
}

.archive-list {
    list-style: none;
    margin: 4px 0 8px;
    padding: 2px 0 2px 26px;
    border-left: 1px solid var(--border);
}

.archive-list li {
    line-height: 2.2;
    font-size: 14px;
    white-space: normal;
}

.archive-day {
    color: var(--muted);
}

.archive-list a {
    color: var(--link);
    text-decoration: underline;
}

.archive-list a:hover {
    color: var(--link-hover);
}

.archive-meta {
    color: var(--muted);
    font-size: 12px;
}

/* ========== 相册分类模板（category/{缩略名}.php，如 photo） ========== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 0 0 24px;
}

.photo-card {
    position: relative;
    display: block;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--heading-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    transition: transform .2s ease, box-shadow .2s ease;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
}

.photo-card-cover {
    position: absolute;
    inset: 0;
}

.photo-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.photo-card:hover .photo-card-cover img {
    transform: scale(1.04);
}

.photo-card-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px 10px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.photo-card-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-card-meta {
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
}

@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
