/*
Theme Name: CM Geek
Theme URI: https://cm.zy1080.xyz
Author: cm.zy1080.xyz
Author URI: https://cm.zy1080.xyz
Description: 现代化极客风主题：暗色界面、等宽字体、代码高亮，深度支持代码块/代码片段。以技术为开端。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cm-geek
Tags: dark, code, developer, blog, one-column, custom-menu, sticky-post
*/

/* ==========================================================================
   基础变量（GitHub Dark 风格）
   ========================================================================== */
:root {
    --bg: #0d1117;
    --bg-soft: #161b22;
    --bg-card: #161b22;
    --bg-hover: #1c2129;
    --border: #30363d;
    --border-soft: #21262d;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    --text-bright: #f0f6fc;
    --accent: #58a6ff;
    --accent-2: #f78166;
    --accent-3: #3fb950;
    --purple: #bc8cff;
    --code-bg: #161b22;
    --radius: 12px;
    --radius-sm: 8px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code",
        Consolas, "Courier New", monospace;
    --max-w: 860px;
}

/* ==========================================================================
   重置与基础
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88, 166, 255, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 90% 10%, rgba(247, 129, 102, 0.05), transparent);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* 页脚始终贴底 */
.site-main {
    flex: 1 0 auto;
    width: 100%;
}
.site-footer {
    flex-shrink: 0;
    width: 100%;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: #79c0ff; text-decoration: none; }

img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-bright);
    line-height: 1.3;
    font-weight: 650;
    margin: 1.7em 0 0.6em;
    letter-spacing: -0.01em;
}

h1 { font-size: 1.65em; }
h2 { font-size: 1.3em; }
h3 { font-size: 1.12em; }
h4, h5, h6 { font-size: 1em; }

p { margin: 0 0 1.15em; }

/* ==========================================================================
   导航
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.85);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border-soft);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    gap: 16px;
}

.site-brand { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }

.site-brand .site-title {
    font-family: var(--font-mono);
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.02em;
}
.site-brand .site-title a { color: inherit; }
.site-brand .site-title a:hover { color: var(--accent); }

.site-brand .site-tagline {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
    align-items: center;
}

.main-nav li { position: relative; }

.main-nav a {
    display: inline-block;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}
.main-nav .current-menu-item > a::after {
    content: "";
    display: block;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    margin-top: 4px;
}

/* 移动端菜单 */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-bright);
    border-radius: var(--radius-sm);
    padding: 7px 11px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        background: #0d1117;
        border-bottom: 1px solid var(--border-soft);
        padding: 12px 20px 18px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
    .main-nav a { display: block; }
    .site-header {
        background: #0d1117;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* ==========================================================================
   布局
   ========================================================================== */
.site-main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 44px 22px 64px;
}

.site-main.wide { max-width: 1100px; }

/* ==========================================================================
   文章列表（卡片）
   ========================================================================== */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 26px 28px;
    margin-bottom: 24px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover {
    border-color: var(--border);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.post-card h2 { margin-top: 0; font-size: 1.3em; }
.post-card h2 a { color: var(--text-bright); }
.post-card h2 a:hover { color: var(--accent); }

.entry-meta {
    font-size: 0.82rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.entry-meta span { white-space: nowrap; }
.entry-meta .sep { color: var(--border); }

.post-card .entry-excerpt { color: var(--text); }
.post-card .entry-excerpt p:last-child { margin-bottom: 0; }

.read-more {
    display: inline-block;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
}
.read-more:hover { color: #79c0ff; }
.read-more::after { content: " →"; }

/* ==========================================================================
   单篇文章
   ========================================================================== */
.single-post .entry-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}
.single-post .entry-title {
    font-size: 1.8em;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
    line-height: 1.28;
    background: linear-gradient(135deg, #f0f6fc 20%, #79c0ff 70%, #bc8cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--text-bright);
}
.single-post .entry-meta { margin-bottom: 0; }

.entry-content {
    font-size: 0.99rem;
    word-wrap: break-word;
}
.entry-content > *:first-child { margin-top: 0; }

/* 正文中的链接带下划线 */
.entry-content a { border-bottom: 1px solid rgba(88, 166, 255, 0.4); }
.entry-content a:hover { border-bottom-color: var(--accent); }

/* 列表 */
.entry-content ul, .entry-content ol {
    padding-left: 1.5em;
    margin: 0 0 1.15em;
}
.entry-content li { margin-bottom: 0.4em; }
.entry-content li::marker { color: var(--accent); }

/* 引用 */
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 14px 20px;
    border-left: 3px solid var(--accent);
    background: var(--bg-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-dim);
    font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

/* 分隔线 */
.entry-content hr {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 2.2em 0;
}

/* 表格 */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 0.95rem;
}
.entry-content th, .entry-content td {
    border: 1px solid var(--border-soft);
    padding: 9px 14px;
    text-align: left;
}
.entry-content th {
    background: var(--bg-soft);
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 0.88rem;
}

/* ==========================================================================
   代码块与代码片段（highlight.js 增强）
   ========================================================================== */
code, kbd, samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-hover);
    color: var(--text-bright);
    border-radius: 5px;
    padding: 0.15em 0.4em;
}

pre {
    background: var(--code-bg) !important;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    line-height: 1.6;
    margin: 1.3em 0;
    font-size: 0.88rem;
    position: relative;
    max-width: 100%;
    scrollbar-color: var(--border) var(--bg);
    scrollbar-width: thin;
}
pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}
pre code.hljs {
    display: block;
    overflow-x: auto;
    padding: 0;
    white-space: pre;
    word-break: normal;
}

/* 代码块语言标签（左上角） */
pre::before {
    content: "code";
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    background: var(--bg-soft);
    padding: 3px 12px;
    border-radius: 0 0 6px 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
pre:has(code.language-php)::before { content: "PHP"; color: #79c0ff; }
pre:has(code.language-bash)::before,
pre:has(code.language-shell)::before { content: "Shell"; color: #3fb950; }
pre:has(code.language-javascript)::before,
pre:has(code.language-js)::before { content: "JavaScript"; color: #f0c674; }
pre:has(code.language-python)::before { content: "Python"; color: #f78166; }
pre:has(code.language-html)::before { content: "HTML"; color: #f78166; }
pre:has(code.language-css)::before { content: "CSS"; color: #bc8cff; }
pre:has(code.language-nginx)::before { content: "Nginx"; color: #3fb950; }
pre:has(code.language-sql)::before { content: "SQL"; color: #79c0ff; }
pre:has(code.language-go)::before { content: "Go"; color: #56b6c2; }
pre:has(code.language-rust)::before { content: "Rust"; color: #f78166; }

/* 代码复制按钮 */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1;
    color: var(--text-dim);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.code-copy-btn:hover {
    color: var(--text-bright);
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.12);
}
.code-copy-btn.copied {
    color: var(--accent-3);
    border-color: var(--accent-3);
}

/* 行内代码在代码块内不叠加背景 */
pre code.hljs, pre code:not(.hljs) { padding: 0 !important; }

/* 古腾堡代码块 */
.wp-block-code {
    border: none;
    background: transparent;
    padding: 0;
}
.wp-block-code code { display: block; }

/* ==========================================================================
   评论 / 留言板
   ========================================================================== */
.comments-area {
    margin-top: 44px;
    padding-top: 32px;
    border-top: 1px solid var(--border-soft);
}

.comments-title, .comment-reply-title {
    font-size: 1.25em;
    font-family: var(--font-mono);
    color: var(--text-bright);
    margin-bottom: 18px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}
.comment-list .comment { margin-bottom: 18px; }
.comment-list .children { list-style: none; padding-left: 30px; margin-top: 18px; border-left: 1px solid var(--border-soft); }

.comment-body {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 18px 22px;
}

.comment-author { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .fn { font-weight: 600; color: var(--text-bright); font-style: normal; }
.comment-author .fn a { color: var(--text-bright); }
.comment-author .says { display: none; }

.comment-metadata { font-size: 0.78rem; color: var(--text-dim); font-family: var(--font-mono); margin-bottom: 10px; }
.comment-metadata a { color: var(--text-dim); }

.comment-content { font-size: 0.97rem; }
.comment-content p:last-child { margin-bottom: 0; }

.reply { margin-top: 10px; }
.reply a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
}

.comment-respond { margin-top: 26px; }

.comment-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    margin-bottom: 16px;
    transition: border-color 0.15s ease;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.comment-form .submit,
button[type="submit"],
input[type="submit"] {
    background: linear-gradient(135deg, var(--accent), #1f6feb);
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.comment-form .submit:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.comment-notes, .comment-form-comment { margin-bottom: 16px; }
.comment-form-comment label { margin-bottom: 8px; }
.form-submit { margin: 0; }

/* 待审核提示 */
.comment-body .comment-awaiting-moderation {
    color: #f0c674;
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

/* ==========================================================================
   分页
   ========================================================================== */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 34px;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.88rem;
}
.pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--accent), #1f6feb);
    border-color: transparent;
    color: #fff;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   文章导航
   ========================================================================== */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border-soft);
    font-family: var(--font-mono);
    font-size: 0.88rem;
}
.post-navigation a { color: var(--text-dim); }
.post-navigation a:hover { color: var(--accent); }
.post-navigation .nav-next { text-align: right; }

/* ==========================================================================
   页面
   ========================================================================== */
.page-header { margin-bottom: 26px; }
.page-header .page-title {
    font-size: 1.7em;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--border-soft);
    padding: 30px 22px 40px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }
.footer-dot { color: var(--accent-2); }

/* ==========================================================================
   站内信（插件样式）
   ========================================================================== */
.cm-pm-wrap { font-family: var(--font-sans); }

.cm-pm-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 12px;
}
.cm-pm-tabs a {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    color: var(--text);
}
.cm-pm-tabs a.cm-active,
.cm-pm-tabs a:hover { border-color: var(--accent); color: var(--accent); }

.cm-pm-list { list-style: none; padding: 0; margin: 0; }
.cm-pm-list li {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.cm-pm-list li.cm-unread { border-left: 3px solid var(--accent); }
.cm-pm-list .cm-pm-subject { font-weight: 600; color: var(--text-bright); }
.cm-pm-list .cm-pm-meta { font-size: 0.78rem; color: var(--text-dim); font-family: var(--font-mono); }

.cm-pm-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 14px 0 6px;
    font-family: var(--font-mono);
}
.cm-pm-form select,
.cm-pm-form input[type="text"],
.cm-pm-form textarea {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
}
.cm-pm-form select:focus,
.cm-pm-form input:focus,
.cm-pm-form textarea:focus { outline: none; border-color: var(--accent); }

.cm-pm-notice {
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.4);
    color: #3fb950;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
}
.cm-pm-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.4);
    color: #f85149;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
}
.cm-pm-login-hint {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 30px;
    text-align: center;
    color: var(--text-dim);
}
.cm-pm-login-hint a { color: var(--accent); }

.cm-pm-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 22px 26px;
}
.cm-pm-detail .cm-pm-d-meta { font-size: 0.82rem; color: var(--text-dim); font-family: var(--font-mono); margin-bottom: 16px; }
.cm-pm-detail .cm-pm-d-content { white-space: pre-wrap; word-break: break-word; }

.cm-pm-form .cm-pm-actions { display: flex; gap: 10px; margin-top: 18px; }

/* 空状态 */
.cm-empty {
    color: var(--text-dim);
    text-align: center;
    padding: 34px 0;
    font-family: var(--font-mono);
}

/* ==========================================================================
   杂项
   ========================================================================== */
.aligncenter { display: block; margin: 0 auto; }
.alignleft { float: left; margin: 0 20px 14px 0; }
.alignright { float: right; margin: 0 0 14px 20px; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.82rem; color: var(--text-dim); text-align: center; }

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
}

/* 搜索表单 */
.search-form { display: flex; gap: 8px; max-width: 420px; }
.search-form input[type="search"] {
    flex: 1;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 14px;
    font-size: 0.95rem;
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--accent); }

/* 404 */
.error-404 { text-align: center; padding: 60px 0; }
.error-404 h1 { font-size: 4.5em; font-family: var(--font-mono); margin: 0 0 10px; background: linear-gradient(135deg, var(--accent), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

::selection { background: rgba(88, 166, 255, 0.3); color: var(--text-bright); }

/* 响应式 */
@media (max-width: 720px) {
    .site-main { padding: 30px 16px 48px; }
    .post-card { padding: 20px 18px; }
    .single-post .entry-title { font-size: 1.6em; }
    .comment-list .children { padding-left: 16px; }
    .header-inner { padding: 0 14px; }
}

/* ==========================================================================
   文章分享
   ========================================================================== */
.share-box {
    margin-top: 44px;
    padding-top: 26px;
    border-top: 1px solid var(--border-soft);
}
.share-box h3 {
    font-size: 0.95rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    margin: 0 0 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.share-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 8px 15px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
}
.share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    text-decoration: none;
}
.share-btn .share-ico { font-size: 1rem; line-height: 1; }
.share-btn.share-x:hover { border-color: #1d9bf0; color: #1d9bf0; }
.share-btn.share-weibo:hover { border-color: #e6162d; color: #e6162d; }
.share-btn.share-qq:hover { border-color: #12b7f5; color: #12b7f5; }
.share-btn.share-wechat:hover { border-color: #07c160; color: #07c160; }
.share-btn.share-link:hover { border-color: var(--accent-3); color: var(--accent-3); }

/* 分享反馈提示 */
.share-tip {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    border: 1px solid var(--accent-3);
    color: var(--accent-3);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 999;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.share-tip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 微信二维码弹层 */
.qr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.qr-overlay.show { display: flex; }
.qr-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 30px;
    text-align: center;
    max-width: 90vw;
}
.qr-modal h4 {
    margin: 0 0 16px;
    font-family: var(--font-mono);
    color: var(--text-bright);
    font-size: 1rem;
}
.qr-modal #share-qr { display: inline-block; padding: 10px; background: #fff; border-radius: 8px; }
.qr-modal p { margin: 14px 0 0; font-size: 0.8rem; color: var(--text-dim); font-family: var(--font-mono); }
.qr-close {
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 7px 20px;
    cursor: pointer;
}
.qr-close:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   站内公告
   ========================================================================== */
.site-notice {
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.14), rgba(188, 140, 255, 0.12));
    border-bottom: 1px solid var(--border-soft);
    padding: 10px 46px 10px 22px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text);
    position: relative;
}
.site-notice a { color: var(--accent); }
.site-notice .notice-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.site-notice .notice-close:hover { color: var(--text-bright); background: var(--bg-hover); }

/* 公告管理后台 */
.cm-notice-admin { max-width: 720px; }
.cm-notice-admin .cm-field { margin-bottom: 18px; }
.cm-notice-admin label { display: block; font-weight: 600; margin-bottom: 6px; }
.cm-notice-admin textarea { width: 100%; min-height: 160px; font-family: var(--font-mono); }
.cm-notice-admin .cm-hint { color: #666; font-size: 12px; margin-top: 4px; }

/* ==========================================================================
   页眉站内搜索
   ========================================================================== */
.header-search {
    display: flex;
    align-items: center;
    position: relative;
}
.header-search form {
    display: flex;
    align-items: center;
    margin: 0;
}
.header-search .search-field {
    width: 150px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    padding: 6px 34px 6px 14px;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    transition: width 0.2s ease, border-color 0.15s ease;
}
.header-search .search-field:focus {
    outline: none;
    border-color: var(--accent);
    width: 190px;
}
.header-search .search-submit {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}
.header-search .search-submit:hover { color: var(--accent); }
.header-search .screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
}

/* 搜索切换按钮：桌面端隐藏，移动端显示为放大镜 */
.search-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    line-height: 1;
    align-items: center;
    justify-content: center;
}
.search-toggle:hover { color: var(--accent); background: var(--bg-hover); }

@media (max-width: 860px) {
    .header-search form { display: none; }
    .header-search.open form {
        display: flex;
        position: absolute;
        top: 48px;
        right: 0;
        background: #0d1117;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 8px;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
        z-index: 90;
    }
    .header-search .search-field { width: 200px; }
    .header-search .search-field:focus { width: 200px; }
    .search-toggle { display: inline-flex; }
}

/* ==========================================================================
   分类 / 归档页面
   ========================================================================== */
.cm-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.cm-list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.cm-list-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.cm-list-card .cm-card-name { color: var(--text-bright); font-weight: 600; font-size: 0.95rem; }
.cm-list-card .cm-card-count {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    background: var(--bg-hover);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
}

.cm-archive-year { margin-bottom: 26px; }
.cm-archive-year h2 {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.cm-archive-year h2::before { content: "# "; color: var(--accent); }
.cm-archive-year ul { list-style: none; margin: 0; padding: 0; }
.cm-archive-year li {
    padding: 7px 0;
    border-bottom: 1px dashed var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
}
.cm-archive-year li:last-child { border-bottom: none; }
.cm-archive-year .cm-arch-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    flex-shrink: 0;
}
.cm-archive-year a { color: var(--text); }
.cm-archive-year a:hover { color: var(--accent); }

/* ==========================================================================
   编辑器：CM 代码块（后台样式）
   ========================================================================== */
.wp-block-cm-geek-code { position: relative; }
.wp-block-cm-geek-code .cm-code-lang {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    background: var(--bg-soft);
    padding: 2px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
}
.editor-styles-wrapper .wp-block-cm-geek-code textarea {
    font-family: var(--font-mono) !important;
    font-size: 0.85rem !important;
    background: #161b22 !important;
    color: #c9d1d9 !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    padding: 14px !important;
    min-height: 140px !important;
}

/* ==========================================================================
   文章目录（cm-geek/toc）
   ========================================================================== */
.cm-toc {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 26px 0;
}
.cm-toc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}
.cm-toc-title::before {
    content: '▤';
    margin-right: 8px;
    color: var(--accent);
}
.cm-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: cmtoc;
}
.cm-toc-item {
    margin: 0;
}
.cm-toc-item a {
    display: block;
    padding: 5px 8px;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.5;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
}
.cm-toc-item a:hover {
    background: var(--bg-hover);
    color: var(--accent);
}
.cm-toc-item a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--bg-hover);
}
.cm-toc-l2 a { padding-left: 14px; }
.cm-toc-l3 a { padding-left: 28px; font-size: 0.82rem; }
.cm-toc-l4 a { padding-left: 40px; font-size: 0.8rem; }

/* 编辑器预览 */
.cm-toc-preview {
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    color: var(--text-dim);
    background: var(--bg-soft);
}
.cm-toc-preview-title {
    display: block;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.cm-toc-preview-note {
    font-size: 0.8rem;
}

/* ==========================================================================
   内联 SVG 图表（cm-geek/chart）
   ========================================================================== */
.cm-chart {
    margin: 24px 0;
    padding: 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.cm-chart figcaption {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 12px;
    font-family: var(--font-mono);
}
.cm-chart svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 620px;
    margin: 0 auto;
}
.cm-chart-preview {
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    color: var(--text-dim);
    background: var(--bg-soft);
}
.cm-chart-preview-title {
    display: block;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.cm-chart-preview-note {
    font-size: 0.8rem;
}

/* 编辑器目录预览 - 示例列表 */
.cm-toc-sample {
    list-style: none;
    margin: 10px 0;
    padding: 0;
    text-align: left;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}
.cm-toc-sample li {
    padding: 3px 8px;
    font-size: 0.84rem;
    color: var(--text);
    border-left: 2px solid var(--border);
    margin-bottom: 2px;
}
.cm-toc-sample .cm-toc-sample-l3 {
    padding-left: 22px;
    color: var(--text-dim);
}

/* ==========================================================================
   目录侧边栏（PC sticky 右侧 / 移动端抽屉）
   ========================================================================== */
/* PC：正文 + 右侧目录双栏 */
@media (min-width: 861px) {
	.single-layout.has-toc {
		display: flex;
		gap: 40px;
		align-items: flex-start;
	}
	.single-layout.has-toc .single-main {
		flex: 1;
		min-width: 0;
	}
	.toc-rail {
		flex: 0 0 250px;
		position: sticky;
		top: 90px;
		max-height: calc(100vh - 120px);
		overflow-y: auto;
		scrollbar-width: thin;
		scrollbar-color: var(--border) transparent;
	}
	.toc-rail-backdrop {
		display: none !important;
	}
	.toc-drawer-toggle {
		display: none !important;
	}
	/* 侧栏内目录卡片样式覆写（紧凑、无背景卡片） */
	.toc-rail .cm-toc {
		margin: 0;
		padding: 0;
		background: transparent;
		border: none;
		border-radius: 0;
	}
	.toc-rail .cm-toc-title {
		font-size: 0.78rem;
		text-transform: uppercase;
		letter-spacing: 0.1em;
		color: var(--text-dim);
		margin-bottom: 10px;
		padding-bottom: 8px;
		border-bottom: 1px solid var(--border);
	}
	.toc-rail .cm-toc-title::before {
		content: none;
	}
	.toc-rail .cm-toc-item a {
		padding: 5px 10px;
		font-size: 0.83rem;
		border-left: 2px solid transparent;
		background: transparent;
	}
	.toc-rail .cm-toc-item a:hover {
		background: transparent;
		color: var(--accent);
	}
	.toc-rail .cm-toc-item a.active {
		background: transparent;
		border-left-color: var(--accent);
		color: var(--accent);
	}
	.toc-rail .cm-toc-l2 a { padding-left: 10px; }
	.toc-rail .cm-toc-l3 a { padding-left: 22px; }
	.toc-rail .cm-toc-l4 a { padding-left: 34px; }
}

/* 移动端：抽屉 + 悬浮按钮 */
@media (max-width: 860px) {
	.toc-rail {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(80vw, 320px);
		z-index: 1001;
		background: var(--bg-card, #fff);
		box-shadow: -12px 0 32px rgba(0, 0, 0, 0.25);
		transform: translateX(105%);
		transition: transform 0.28s ease;
		overflow-y: auto;
		padding: 20px 18px;
		-webkit-overflow-scrolling: touch;
	}
	.toc-rail.open {
		transform: translateX(0);
	}
	.toc-rail-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		z-index: 1000;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease;
	}
	.toc-rail.open .toc-rail-backdrop {
		opacity: 1;
		pointer-events: auto;
	}
	body.toc-open {
		overflow: hidden;
	}
	.toc-rail .cm-toc {
		margin: 0;
		padding: 0;
		background: transparent;
		border: none;
	}
	.toc-rail .cm-toc-title {
		font-size: 0.95rem;
		font-weight: 700;
		color: var(--heading);
		margin-bottom: 14px;
		padding-bottom: 10px;
		border-bottom: 1px solid var(--border);
	}
	.toc-rail .cm-toc-title::before {
		content: none;
	}
	.toc-drawer-toggle {
		display: inline-flex;
		position: fixed;
		right: 16px;
		bottom: 86px;
		z-index: 1002;
		align-items: center;
		gap: 6px;
		background: var(--accent);
		color: #fff;
		border: none;
		border-radius: 999px;
		padding: 10px 16px;
		font-size: 0.85rem;
		font-weight: 600;
		font-family: inherit;
		box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
		cursor: pointer;
		transition: transform 0.15s ease, opacity 0.15s ease;
	}
	.toc-drawer-toggle:active {
		transform: scale(0.94);
	}
	.toc-drawer-toggle svg {
		display: block;
	}
}

/* ==========================================================================
   图片灯箱（点击放大，含外站图片）
   ========================================================================== */
.entry-content img:not(a img) {
	cursor: zoom-in;
}
.cm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: zoom-out;
	animation: cm-lb-fade 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}
.cm-lightbox-stage {
	position: relative;
	max-width: 94vw;
	max-height: 92vh;
	display: flex;
	align-items: center;
	justify-content: center;
}
.cm-lightbox-stage img {
	max-width: 94vw;
	max-height: 92vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
	cursor: zoom-in;
	transition: transform 0.2s ease;
	animation: cm-lb-zoom 0.22s ease;
	user-select: none;
	-webkit-user-drag: none;
}
.cm-lightbox-close {
	position: fixed;
	top: 16px;
	right: 20px;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}
.cm-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.28);
}
body.lightbox-open {
	overflow: hidden;
}
@keyframes cm-lb-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes cm-lb-zoom {
	from { opacity: 0.4; transform: scale(0.92); }
	to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   文章页宽度：对齐页眉(1100px)，正文宽幅更多但不满幅
   ========================================================================== */
.site-main.single-post { max-width: 1100px; }
.single-layout:not(.has-toc) .single-main {
	max-width: 880px;
	margin-left: auto;
	margin-right: auto;
}

/* ==========================================================================
   浅色模式（data-theme="light"），默认深色
   ========================================================================== */
:root[data-theme="light"] {
	--bg: #ffffff;
	--bg-soft: #f6f8fa;
	--bg-card: #ffffff;
	--bg-hover: #eef1f4;
	--border: #d0d7de;
	--border-soft: #e6ebf1;
	--text: #24292f;
	--text-dim: #59636e;
	--text-bright: #0d1117;
	--accent: #0969da;
	--accent-2: #cf222e;
	--accent-3: #1a7f37;
	--purple: #8250df;
	/* --code-bg 刻意保持深色：代码块固定深色卡，hljs 深色高亮不变 */
}
:root[data-theme="light"] .site-header {
	background: rgba(255, 255, 255, 0.86);
	border-bottom-color: var(--border-soft);
}
:root[data-theme="light"] pre {
	background: var(--code-bg) !important;
	color: #c9d1d9;
}
:root[data-theme="light"] pre code.hljs { color: #c9d1d9; }
:root[data-theme="light"] .cm-toc-item a.active { border-left-color: var(--accent); }

/* 主题切换按钮 */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border: 1px solid var(--border-soft);
	background: transparent;
	color: var(--text-dim);
	border-radius: 8px;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
	padding: 0;
}
.theme-toggle:hover {
	color: var(--accent);
	border-color: var(--border);
	background: var(--bg-hover);
}
.theme-toggle svg {
	width: 16px;
	height: 16px;
	display: block;
}
.theme-toggle .ic-sun { display: block; }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: block; }

/* 页脚站点入口（RSS / 网站地图） */
.footer-links {
	margin-top: 10px;
	font-size: 0.85rem;
}
.footer-links a {
	color: var(--text-dim);
	text-decoration: none;
	transition: color 0.15s ease;
}
.footer-links a:hover {
	color: var(--accent);
	text-decoration: underline;
}

/* ==========================================================================
   浅色模式：文章标题渐变适配（深色渐变，避免近白段被白底吞掉）
   ========================================================================== */
:root[data-theme="light"] .single-post .entry-title {
	background: linear-gradient(135deg, #1f2328 20%, #0969da 70%, #8250df 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--text-bright);
}

/* ==========================================================================
   页脚友情链接（带图标）
   ========================================================================== */
.friend-links {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--border-soft);
}
.friend-links-title {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-dim);
	margin: 0 0 10px;
}
.friend-links-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.friend-links-list li { margin: 0; }
.friend-links-list a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 11px;
	border: 1px solid var(--border-soft);
	border-radius: 999px;
	font-size: 0.82rem;
	color: var(--text-dim);
	text-decoration: none;
	background: var(--bg-soft);
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.friend-links-list a:hover {
	color: var(--accent);
	border-color: var(--border);
	background: var(--bg-hover);
}
.friend-links-list img {
	width: 16px;
	height: 16px;
	border-radius: 3px;
	display: block;
}

/* ==========================================================================
   页脚：融入式友链（内联行）+ 实时时钟
   ========================================================================== */
.footer-clock {
	font-family: var(--font-mono);
	font-size: 0.85em;
	color: var(--text-dim);
	margin-left: 8px;
}
.friend-links-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 16px;
	margin-top: 8px;
	font-size: 0.85rem;
}
.friend-links-label {
	color: var(--text-dim);
}
.friend-links-inline a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--text-dim);
	text-decoration: none;
	transition: color 0.15s ease;
}
.friend-links-inline a:hover {
	color: var(--accent);
}
.friend-links-inline img {
	width: 14px;
	height: 14px;
	border-radius: 2px;
	display: block;
}

/* ==========================================================================
   页脚美观化：居中对齐、与页眉(1100px)对齐、不超出容器
   ========================================================================== */
.footer-inner {
	max-width: 1100px;      /* 与 header-inner 一致 */
	margin: 0 auto;
	text-align: center;
}
.friend-links-inline {
	justify-content: center; /* 换行后第二排仍居中 */
}
.footer-links {
	margin-top: 10px;
}
/* ============================================================
 * cm-geek 主题 · 移动端目录页适配补丁
 * ------------------------------------------------------------
 * 适用站点：cm.zy1080.xyz（WordPress / cm-geek 主题）
 * 补丁内容：分类页(.cm-lists) + 归档页(.cm-archive-year) 移动端优化
 * 应用方式（任选其一）：
 *   A. 宝塔面板 → 文件 → /www/wwwroot/cm/wp-content/themes/cm-geek/
 *      → style.css → 编辑，将以下内容追加到文件末尾保存
 *   B. WordPress 后台 → 外观 → 自定义 → 额外 CSS → 粘贴保存
 * 日期：2026-08-19
 * ============================================================ */

/* ── 归档页 / 分类页：860px 以下，标题可换行、日期不挤压 ── */
@media (max-width: 860px) {
    .cm-archive-year li {
        flex-wrap: wrap;
        gap: 3px 12px;
        padding: 9px 0;
    }
    .cm-archive-year a {
        flex: 1 1 100%;
        min-width: 0;
        line-height: 1.55;
        padding: 2px 0;
    }
    .cm-archive-year .cm-arch-date {
        font-size: 0.75rem;
    }
}

/* ── 分类卡片：720px 以下单列铺满，触控区域加大 ── */
@media (max-width: 720px) {
    .cm-lists {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .cm-list-card {
        padding: 15px 16px;
    }
    .cm-list-card .cm-card-name {
        font-size: 1rem;
    }
    .cm-archive-year h2 {
        font-size: 1.05rem;
    }
}

/* ── 超窄屏（≤480px）进一步收紧 ── */
@media (max-width: 480px) {
    .cm-list-card {
        padding: 13px 14px;
    }
    .cm-archive-year h2 {
        font-size: 1rem;
    }
}
/* ============================================================
 * cm-geek 主题 · 文章目录列表(post-card)移动端适配补丁
 * ------------------------------------------------------------
 * 适用站点：cm.zy1080.xyz（WordPress / cm-geek 主题）
 * 覆盖页面：首页 / 分类页(/category/xxx) / 标签页 / 日期归档页
 * 方案参考：同类技术博客移动端列表 ——
 *   ① 紧凑卡片：收窄内边距、减小卡片间距
 *   ② 标题最多 2 行（超出省略），行高加大避免挤压
 *   ③ 摘要最多 3 行（超出省略），窄屏不再撑爆版面
 *   ④ meta 字号/间距收紧，日期+作者不换行挤压
 *   ⑤ 阅读全文加大触控区域
 * 日期：2026-08-19
 * ============================================================ */

/* ── ≤860px：平板/大手机 ── */
@media (max-width: 860px) {
    .post-card {
        padding: 20px 20px;
        margin-bottom: 16px;
    }
    .post-card h2 {
        font-size: 1.16em;
        line-height: 1.45;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }
    .entry-meta {
        font-size: 0.75rem;
        gap: 8px;
        margin-bottom: 10px;
    }
    .post-card .entry-excerpt {
        font-size: 0.9rem;
        line-height: 1.65;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }
    .read-more {
        margin-top: 12px;
        padding: 6px 0;
        font-size: 0.82rem;
    }
}

/* ── ≤480px：超窄屏进一步收紧 ── */
@media (max-width: 480px) {
    .post-card {
        padding: 18px 16px;
        margin-bottom: 14px;
    }
    .post-card h2 {
        font-size: 1.05em;
    }
    .page-header .page-title {
        font-size: 1.25rem;
    }
    .archive-description {
        font-size: 0.85rem;
    }
}

/* ── 文章目录悬浮按钮：更贴近拇指、加阴影分层 ── */
@media (max-width: 860px) {
    .toc-drawer-toggle {
        right: 14px;
        bottom: 24px;
        padding: 12px 18px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }
}
/* ==========================================================================
   移动端文章目录浮窗化（cm-geek/toc）
   覆盖原"右侧全高抽屉"样式 → 右下角浮窗面板：
   - 右下角悬浮"目录"按钮（原有）→ 点击弹出浮窗
   - 浮窗顶部标题固定显示"目录"两个字
   - 点击目录项平滑定位到文章对应章节，并自动关闭浮窗
   桌面端（>=861px）右侧 sticky 侧栏不受影响
   ========================================================================== */

@media (max-width: 860px) {
    /* 浮窗面板：从按钮方向弹出，替代原全高抽屉 */
    .toc-rail {
        top: auto;
        left: auto;
        right: 14px;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        width: min(80vw, 300px);
        max-height: 62vh;
        padding: 16px 14px;
        background: var(--bg-card, #fff);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.30);
        transform-origin: bottom right;
        transform: translateY(16px) scale(0.94);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
    }

    .toc-rail.open {
        transform: translateY(0) scale(1);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* 遮罩：调浅半透明，仍可点击关闭浮窗 */
    .toc-rail-backdrop {
        background: rgba(0, 0, 0, 0.32);
    }

    /* 浮窗标题栏：固定显示"目录"两个字 */
    .toc-rail .cm-toc-title {
        display: flex;
        align-items: center;
        font-size: 0; /* 隐藏 PHP 原输出文字，统一显示"目录" */
        margin: 0 0 10px;
        padding: 0 0 10px;
        border-bottom: 1px solid var(--border);
        letter-spacing: 0;
    }
    .toc-rail .cm-toc-title::before {
        content: "目录";
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--heading);
    }

    /* 目录项：加大触控区域，方便手指点击 */
    .toc-rail .cm-toc-item a {
        padding: 7px 10px;
        font-size: 0.88rem;
        line-height: 1.5;
    }
}

/* 超窄屏：浮窗再放宽一点 */
@media (max-width: 480px) {
    .toc-rail {
        width: min(86vw, 320px);
        max-height: 58vh;
    }
}
/* ==========================================================================
   修复补丁：浮窗目录点击失效（2026-08-19）
   根因：.toc-rail 带 transform（translateY/scale）会创建新的 containing block，
         使内部 .toc-rail-backdrop 的 position:fixed 相对浮窗而非视口，
         且 backdrop z-index(1000) 高于目录内容(默认 auto)，
         → 遮罩盖住整个目录列表，点击目录项实际命中遮罩 → 触发关闭而非定位。
   修复：去掉浮窗 transform（动画改用 opacity/visibility，遮罩恢复全屏），
         目录内容显式 z-index 提升到遮罩之上，保证可点击。
   交互：点"目录"按钮 → 浮窗弹出（全屏半透明遮罩 + 右下角浮窗）
         点目录项 → 平滑定位 + 高亮 + 自动关闭
         点遮罩 / ESC / 点目录项 → 关闭
   桌面端（>=861px）右侧 sticky 侧栏不受影响
   ========================================================================== */
@media (max-width: 860px) {
    /* 1. 浮窗：去掉 transform（fixed 子元素回归视口定位），动画改用 opacity/visibility */
    .toc-rail {
        transform: none !important;
        transition: opacity 0.22s ease, visibility 0.22s ease !important;
    }
    .toc-rail.open {
        transform: none !important;
    }

    /* 2. 遮罩：全屏、位于浮窗之下页面之上；关闭时完全不拦截任何点击 */
    .toc-rail-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 1000 !important;
        background: rgba(0, 0, 0, 0.35) !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0.22s ease;
    }
    .toc-rail.open .toc-rail-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* 3. 目录内容：显式提升到遮罩之上，链接恢复可点击 */
    .toc-rail .cm-toc {
        position: relative !important;
        z-index: 1002 !important;
        pointer-events: auto !important;
    }

    /* 4. 目录链接本身确保可点击（排除任何继承的 pointer-events 干扰） */
    .toc-rail .cm-toc a {
        pointer-events: auto !important;
        cursor: pointer;
    }

    /* 5. 浮窗面板层级稳固在遮罩之上（rail 1001 > backdrop 1000） */
    .toc-rail {
        z-index: 1001 !important;
    }
}

/* ==========================================================================
   移动端主导航菜单可见性修复（cm-geek 主题，2026-08-19）
   --------------------------------------------------------------------------
   根因：
     原 .main-nav 在 @media (max-width: 860px) 硬编码 background: #0d1117
     （深黑），而 .main-nav a 的默认 color 是 #24292f（深灰近黑）。
     在浅色主题下，深色背景 + 深色文字对比度几乎为 0（~1.2:1，远低于
     WCAG 4.5:1 标准），菜单内容（首页/留言板/分类/归档等 7 项）
     完全看不清，用户以为"菜单没展开/没反应"。
   修复：
     1. 菜单背景从硬编码 #0d1117 改为跟随主题的 var(--bg-card)；
     2. 菜单文字改为跟随主题的 var(--text-bright)；
     3. hover/focus 增加主题强调色 + 浅背景反馈；
     4. 当前菜单项保持主题强调色；
     5. 汉堡按钮在菜单打开时（.open）变强调色，提供视觉反馈；
     6. 提升 z-index 防止被其他层遮挡，加滚动以防菜单项过多溢出。
   不影响：桌面端（>=861px）主导航保持原横向布局不变。
   ========================================================================== */
@media (max-width: 860px) {
    /* 1. 菜单面板：背景跟随主题（覆盖硬编码 #0d1117） */
    .main-nav {
        background: var(--bg-card, #ffffff) !important;
        border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08)) !important;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12) !important;
        z-index: 99 !important;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 2. 菜单链接：跟随后景色，深色背景配深色文字 → 改为浅色背景配深色文字 */
    .main-nav a {
        color: var(--text-bright, #1f2328) !important;
        padding: 12px 8px !important;
        font-size: 0.95rem;
        border-radius: 6px;
        transition: color 0.15s ease, background 0.15s ease;
    }

    /* 3. hover/focus：主题强调色 + 浅背景 */
    .main-nav a:hover,
    .main-nav a:focus {
        color: var(--accent, #2563eb) !important;
        background: var(--bg-soft, rgba(0, 0, 0, 0.04)) !important;
    }

    /* 4. 当前菜单项：保持主题强调色（与原主题一致） */
    .main-nav .current-menu-item > a,
    .main-nav .current_page_item > a {
        color: var(--accent, #2563eb) !important;
    }

    /* 5. 汉堡按钮在菜单展开时（.open）变强调色，提供视觉反馈 */
    .nav-toggle.open {
        color: var(--accent, #2563eb) !important;
        border-color: var(--accent, #2563eb) !important;
    }

    /* 6. 子菜单（如有）样式兜底 */
    .main-nav .sub-menu {
        background: transparent;
        padding-left: 12px;
    }
}
/* ==========================================================================
   CM API 开放平台页面样式（配合 cm-geek 主题变量，深浅色自适应）
   ========================================================================== */
.cm-api-platform {
    max-width: 900px;
    margin: 0 auto;
}
.cm-api-platform .cm-api-hero {
    padding: 8px 0 20px;
}
.cm-api-platform .cm-api-hero h2 {
    margin: 0 0 8px;
    font-size: 1.5em;
}
.cm-api-platform .cm-api-hero p {
    margin: 0 0 8px;
    color: var(--text-dim);
}
.cm-api-platform .cm-api-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 18px;
}
.cm-api-platform .cm-api-card h3 {
    margin: 0 0 12px;
    font-size: 1.05em;
}
.cm-api-platform .cm-api-card h4 {
    margin: 16px 0 8px;
    font-size: 0.95em;
    color: var(--text-dim);
}
.cm-api-platform .cm-api-hint {
    color: var(--text-dim);
    font-size: 0.88rem;
}
.cm-api-platform .cm-api-key-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.cm-api-platform .cm-api-key {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--accent);
}
.cm-api-platform .cm-api-meta {
    color: var(--text-dim);
    font-size: 0.82rem;
}
.cm-api-platform .cm-api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 8px 0;
}
.cm-api-platform .cm-api-table th,
.cm-api-platform .cm-api-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-soft);
}
.cm-api-platform .cm-api-table th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.8rem;
}
.cm-api-platform .cm-api-method {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--bg-soft);
    padding: 2px 8px;
    border-radius: 4px;
}
.cm-api-platform .cm-api-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 6px 0 4px;
}
.cm-api-platform .cm-api-stat {
    flex: 1;
    min-width: 120px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}
.cm-api-platform .cm-api-stat .num {
    display: block;
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-bright);
    font-family: var(--font-mono);
}
.cm-api-platform .cm-api-stat .lbl {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 2px;
}
.cm-api-platform .cm-api-btn {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff !important;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.cm-api-platform .cm-api-btn:hover { opacity: 0.85; }
.cm-api-platform .cm-api-btn-danger {
    background: var(--accent-2, #cf222e);
}
.cm-api-platform .cm-api-notice {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.35);
    color: var(--accent-3, #1a7f37);
    font-size: 0.88rem;
}
.cm-api-platform .cm-api-pre {
    background: var(--code-bg, #161b22);
    color: #c9d1d9;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.6;
}
.cm-api-platform .cm-api-pre code,
.cm-api-platform .cm-api-card code {
    font-family: var(--font-mono);
    background: var(--bg-soft);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* ==========================================================================
   cm-geek 主题 · 粒子背景层样式（2026-08-19）
   --------------------------------------------------------------------------
   #cm-particles 由 JS 动态创建并插入 body 开头，作为固定背景层：
   - z-index: -1 置于内容背景之下、body 背景之上，不遮挡任何内容与文字
   - pointer-events: none 完全穿透，不影响点击/滚动/复制
   ========================================================================== */
#cm-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    display: block;
}
/* ==========================================================================
   CM Steam 模块样式：页眉手柄入口 + 游戏趋势表格（每行右侧迷你趋势图）
   ========================================================================== */

/* ---------- 页眉手柄图标入口（导航菜单左侧，非菜单项） ---------- */
.games-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-dim);
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.games-link:hover {
    color: var(--accent);
    border-color: var(--border);
    background: var(--bg-hover);
}
.games-link svg { width: 17px; height: 17px; display: block; }

/* ---------- 游戏数据页面 ---------- */
.cm-steam-wrap { max-width: 1000px; margin: 0 auto; }
.cm-steam-wrap .cm-steam-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.cm-steam-wrap .cm-steam-head h2 { margin: 0; font-size: 1.4em; }
.cm-steam-wrap .cm-steam-updated { color: var(--text-dim); font-size: 0.82rem; margin: 0; }
.cm-steam-wrap .cm-steam-empty { color: var(--text-dim); padding: 30px 0; text-align: center; }

/* 时间范围切换 */
.cm-steam-ranges { display: flex; gap: 6px; margin-bottom: 16px; }
.cm-range-btn {
    padding: 5px 14px;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cm-range-btn:hover { color: var(--text); }
.cm-range-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 区块 */
.cm-steam-section { margin-bottom: 22px; }
.cm-steam-section-title {
    font-size: 1.05em;
    margin: 0 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
}

/* 游戏表格（每行右侧迷你趋势图） */
.cm-steam-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.9rem;
}
.cm-steam-table th,
.cm-steam-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.cm-steam-table thead th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.75rem;
    background: var(--bg-soft);
    white-space: nowrap;
}
.cm-steam-table tbody tr:last-child td { border-bottom: none; }
.cm-steam-table tbody tr:hover td { background: var(--bg-hover); }
.cm-steam-table .r { text-align: center; width: 44px; color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem; }
.cm-steam-table .name { font-weight: 600; }
.cm-steam-table .n { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.cm-steam-table .peak { color: var(--text-dim); }
.cm-steam-table td.spark { width: 220px; padding: 4px 8px; }

/* 迷你趋势图（统一高度 48px） */
.cm-spark { width: 100%; height: 48px; display: block; }

/* ---------- 移动端响应式 ---------- */
@media (max-width: 860px) {
    .cm-steam-table td.spark { width: 140px; }
    .cm-spark { height: 40px; }
}
@media (max-width: 560px) {
    .cm-steam-table th.peak, .cm-steam-table td.peak { display: none; }
    .cm-steam-table td.spark { width: 110px; }
    .cm-spark { height: 36px; }
    .cm-steam-table th, .cm-steam-table td { padding: 7px 8px; font-size: 0.82rem; }
}

/* ---------- 公开通道（大字标注） ---------- */
.cm-api-platform .cm-api-public {
    border-left: 4px solid var(--accent);
    background: linear-gradient(180deg, var(--bg-soft), var(--bg-card));
}
.cm-api-platform .cm-api-public-title {
    font-size: 1.45em;
    color: var(--accent);
    margin: 0 0 8px;
    font-weight: 700;
}
.cm-api-platform .cm-api-public-desc {
    font-size: 1.02rem;
    color: var(--text-bright);
    margin: 0 0 10px;
}
.cm-api-platform .cm-api-public-url {
    margin: 8px 0;
}
.cm-api-platform .cm-api-public-url code {
    font-family: var(--font-mono);
    font-size: 1.12em;
    font-weight: 700;
    color: var(--accent);
    background: var(--bg-hover);
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: inline-block;
    word-break: break-all;
}

/* ==========================================================================
   网站 Logo（超米标志）
   ========================================================================== */
.site-brand { flex-direction: row; align-items: center; gap: 12px; }
.site-brand .site-logo { flex: none; display: flex; line-height: 0; }
.site-brand .site-logo img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.28);
}
.site-brand .site-tagline {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.01em;
}
@media (max-width: 860px) {
    .site-brand .site-logo img { width: 34px; height: 34px; border-radius: 8px; }
    .site-brand .site-tagline { font-size: 0.85rem; }
}
