/* ============================================
   PHP博客系统 v6.4.1 — 全平台统一抽屉模式
   顶部栏 + 左侧抽屉(分类) + 中间单列内容 + 右侧抽屉(工具)
   电脑端和手机端布局逻辑完全一致，只是尺寸差异
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
    --bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #eeeeee;
    --hover-bg: #f7f7f7;
    --primary: #111111;
    --code-bg: #f6f6f6;
    --radius: 0;

    /* 布局变量 */
    --topbar-height: 52px;
    --content-max-width: 1200px;
    --content-padding-x: 24px;
    --drawer-width: 300px;
}

[data-theme="dark"] {
    --bg: #111111;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    --border: #262626;
    --hover-bg: #1c1c1c;
    --primary: #f5f5f5;
    --code-bg: #1a1a1a;
}

/* ---------- 重置 ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-overflow-scrolling: touch;
}

body.drawer-open-body {
    overflow: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    a:hover {
        color: var(--text-primary);
    }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ================================
   Logo 通用
   ================================ */

.logo-dark { display: none; }
.logo-light { display: block; }

[data-theme="dark"] .logo-dark { display: block; }
[data-theme="dark"] .logo-light { display: none; }

/* ================================
   遮罩层
   ================================ */

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ================================
   顶部栏
   ================================ */

.site-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar-inner {
    height: 100%;
    max-width: calc(var(--content-max-width) + var(--content-padding-x) * 2);
    margin: 0 auto;
    padding: 0 var(--content-padding-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-left,
.topbar-center,
.topbar-right {
    display: flex;
    align-items: center;
}

.topbar-left,
.topbar-right {
    flex: 1;
    min-width: 0;
}

.topbar-right {
    justify-content: flex-end;
}

.topbar-center {
    flex: 0 0 auto;
    justify-content: center;
}

/* 汉堡按钮 */
.topbar-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.topbar-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.topbar-btn .icon {
    width: 20px;
    height: 20px;
}

/* 顶部主题切换按钮 */
.theme-toggle-top .tt-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 亮色模式：显示月亮图标 */
[data-theme="light"] .theme-toggle-top .tt-sun {
    display: none;
}
[data-theme="light"] .theme-toggle-top .tt-moon {
    display: block;
}

/* 暗色模式：显示太阳图标 */
[data-theme="dark"] .theme-toggle-top .tt-sun {
    display: block;
}
[data-theme="dark"] .theme-toggle-top .tt-moon {
    display: none;
}

.hamburger-icon {
    font-size: 20px;
    line-height: 1;
    font-weight: 500;
}

/* Logo */
.topbar-logo {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    letter-spacing: 0.3px;
}

.topbar-logo:hover {
    text-decoration: none;
}

.topbar-logo img {
    height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

/* ================================
   抽屉通用
   ================================ */

.left-drawer,
.right-drawer {
    position: fixed;
    top: 0;
    width: var(--drawer-width);
    max-width: 85vw;
    height: 100vh;
    background: var(--bg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.left-drawer {
    left: 0;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
}

.right-drawer {
    right: 0;
    border-left: 1px solid var(--border);
    transform: translateX(100%);
}

.left-drawer.drawer-open {
    transform: translateX(0);
}

.right-drawer.drawer-open {
    transform: translateX(0);
}

/* 抽屉头部 */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.drawer-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.drawer-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.drawer-close-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.drawer-close-btn .icon {
    width: 18px;
    height: 18px;
}

.close-icon {
    font-size: 14px;
    line-height: 1;
}

/* 抽屉内容 */
.drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
}

.drawer-body::-webkit-scrollbar {
    width: 4px;
}

.drawer-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* 抽屉底部（固定区域） */
.drawer-footer {
    flex-shrink: 0;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    position: relative;
    z-index: 1;
}

/* ================================
   左侧抽屉：分类
   ================================ */

.drawer-cat-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.drawer-cat-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    text-decoration: none;
}

.drawer-cat-item.active {
    color: var(--text-primary);
    font-weight: 500;
    background: var(--hover-bg);
}

.drawer-cat-item .cat-count {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ================================
   右侧抽屉：工具栏
   ================================ */

.drawer-widget {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.drawer-widget:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.drawer-widget-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

/* 标签云 */
.drawer-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.drawer-tag-cloud a {
    color: var(--text-secondary);
    padding: 2px 0;
    transition: color 0.15s ease;
}

.drawer-tag-cloud a:hover {
    color: var(--text-primary);
}

/* 归档列表 */
.drawer-archive-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-archive-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-archive-list a {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-archive-list a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.drawer-archive-list .count {
    font-size: 12px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-left: 8px;
}

/* 关于博主 */
.drawer-author {
    text-align: center;
}

.da-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
}

.da-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.da-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.da-bio {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.da-socials {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.da-socials a {
    font-size: 16px;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.da-socials a:hover {
    color: var(--text-primary);
}

/* 主题切换按钮（抽屉内普通widget，内联SVG保证全浏览器兼容） */
.drawer-widget-theme .drawer-widget-title {
    margin-bottom: 12px;
}

.theme-switch-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.theme-switch-btn:hover {
    border-color: var(--text-tertiary);
    background: var(--hover-bg);
}

.theme-switch-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.theme-icon-light { display: none; }
.theme-icon-dark { display: block; }

[data-theme="dark"] .theme-icon-light { display: block; }
[data-theme="dark"] .theme-icon-dark { display: none; }

/* 主题切换开关 */
.theme-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.theme-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: all 0.25s ease;
}

[data-theme="dark"] .theme-toggle-switch {
    background: var(--primary);
}

[data-theme="dark"] .theme-toggle-switch::after {
    left: 23px;
    background: #1a1a1a;
}

/* ================================
   主内容区
   ================================ */

.main-container {
    position: relative;
    min-height: calc(100vh - 80px);
    padding-top: var(--topbar-height);
}

/* 首页顶部背景图层（铺满全屏宽度，底部渐变透明） */
.hero-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* 底部渐隐：用伪元素渐变代替 mask-image，兼容性更好 */
.hero-bg-layer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 35%;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
    z-index: 1;
}

.hero-bg-layer::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 顶部黑色遮罩：让Hero文字更清晰 */
    background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0) 70%);
}

.content-wrapper {
    position: relative;
    z-index: 1;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 32px var(--content-padding-x) 64px;
    min-height: calc(100vh - var(--topbar-height) - 64px);
    /* v6.13.2：去掉裁切，真自适应 */
    overflow-x: visible;
}

/* 两栏布局 */
.main-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    max-width: 100%;
    /* v6.13.2：去掉裁切，真自适应 */
    overflow-x: visible;
}

.main-content {
    flex: 1;
    min-width: 0;
    /* v6.13.2：去掉裁切，真自适应 */
    overflow-x: visible;
}

.site-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
}

/* 侧边栏widget - 卡片式 */
.sidebar-widget {
    margin-bottom: 20px;
}

/* 统一卡片风格 */
.widget-card {
    background: var(--bg);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease;
}

.widget-card:hover {
    border-color: var(--text-tertiary);
}

.widget-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.widget-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-card-title .icon {
    width: 15px;
    height: 15px;
    color: var(--text-secondary);
}

.widget-card-body {
    padding: 12px 16px 16px;
}

/* 博主信息卡片 */
.widget-author-card .widget-card-body {
    text-align: center;
    padding: 20px 16px;
}

.wa-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    overflow: hidden;
}

.wa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wa-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.wa-bio {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin-bottom: 14px;
}

.wa-socials {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.wa-socials a {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
}

.wa-socials a:hover {
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wa-socials a[title*="GitHub"]:hover { background: #24292e; }
.wa-socials a[title*="微博"]:hover { background: #e6162d; }
.wa-socials a[title*="知乎"]:hover { background: #0066ff; }
.wa-socials a[title*="抖音"]:hover { background: #000; }
.wa-socials a[title*="小红书"]:hover { background: #fe2c55; }
.wa-socials a[title*="快手"]:hover { background: #ff4906; }
.wa-socials a[title*="哔哩哔哩"]:hover { background: #fb7299; }
.wa-socials a[title*="微信"]:hover { background: #07c160; }
.wa-socials a[title*="YouTube"]:hover { background: #ff0000; }
.wa-socials a[title*="Twitter"]:hover { background: #1da1f2; }
.wa-socials a[title*="邮箱"]:hover { background: var(--primary); }

.wa-socials .icon {
    width: 18px;
    height: 18px;
}

/* 二维码弹窗 */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}

.qr-modal.active {
    opacity: 1;
    visibility: visible;
}

.qr-modal-content {
    background: var(--bg);
    border-radius: 16px;
    padding: 28px 32px 24px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.qr-modal.active .qr-modal-content {
    transform: scale(1);
}

.qr-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.qr-modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.qr-modal-close .icon {
    width: 16px;
    height: 16px;
}

.qr-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.qr-modal-image {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    margin: 0 auto 14px;
    display: block;
    border: 1px solid var(--border-light);
}

.qr-modal-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.qr-modal-tip {
    font-size: 12px;
    color: var(--text-tertiary);
    padding-top: 8px;
}

/* 列表类widget */
.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.widget-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget-list li a {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    text-decoration: none;
}

.widget-list li a:hover {
    color: var(--primary);
}

.widget-list-meta {
    font-size: 11px;
    color: var(--text-quaternary);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.widget-list-meta .icon {
    width: 11px;
    height: 11px;
}

/* 评论列表 */
.widget-comment-list .wc-author {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 12px;
}

.widget-comment-list .wc-content {
    color: var(--text-tertiary);
    font-size: 12px;
}

.widget-comment-list li a:hover .wc-content {
    color: var(--text-secondary);
}

/* 归档列表 */
.widget-archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-archive-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.widget-archive-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget-archive-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.widget-archive-list li a:hover {
    color: var(--primary);
}

.archive-count {
    font-size: 11px;
    color: var(--text-quaternary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* 彩色标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.tag-cloud a:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* widget空状态 */
.widget-empty {
    padding: 20px 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* 友情链接widget */
.widget-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.widget-links a {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.widget-links a:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ================================
   搜索框（通用）
   ================================ */

.search-form {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.search-form:focus-within {
    border-color: var(--text-primary);
}

.search-form-multi {
    overflow: visible;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: none;
    outline: none;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
}

.search-form button[type="submit"] {
    padding: 10px 18px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.15s ease;
    cursor: pointer;
}

.search-form button[type="submit"]:hover {
    color: var(--text-primary);
}

.search-form button[type="submit"] .icon {
    width: 16px;
    height: 16px;
}

/* 多引擎搜索 */
.search-engine-select {
    position: relative;
    flex-shrink: 0;
}

.search-engine-current {
    padding: 10px 14px;
    border-right: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.search-engine-current:hover {
    background: var(--hover-bg);
}

.search-engine-arrow {
    font-size: 10px;
    opacity: 0.6;
}

.search-engine-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 4px;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-engine-select.open .search-engine-menu {
    display: block;
}

.search-engine-item {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background-color 0.15s ease;
}

.search-engine-item:hover,
.search-engine-item.active {
    background: var(--hover-bg);
    color: var(--text-primary);
    text-decoration: none;
}

/* ================================
   Hero 区域
   ================================ */

.hero-section {
    padding: 24px 0 40px;
    text-align: center;
}

.hero-section h1 {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.hero-section p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
}

.hero-search .search-form {
    max-width: 100%;
}

/* Hero 背景图（背景层统一提供，Hero 自身透明） */
.hero-with-bg {
    margin: 0 calc(-1 * var(--content-padding-x)) 20px;
    padding: 20px var(--content-padding-x);
    position: relative;
    z-index: 10;
}

.hero-with-bg .hero-inner {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.hero-with-bg h1 {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-with-bg p {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.hero-with-bg .hero-search .search-form {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .hero-with-bg .hero-search .search-form {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.hero-with-bg .search-form input[type="text"] {
    background: transparent;
    color: var(--text-primary);
}

.hero-with-bg .search-engine-current {
    background: transparent;
    color: var(--text-secondary);
    border-right-color: var(--border);
}

/* 有背景图时顶部栏全透明 */
.site-topbar.has-bg {
    background: transparent;
    border-bottom-color: transparent;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.site-topbar.has-bg.scrolled {
    background: var(--bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
    color: var(--text-primary);
}

.site-topbar.has-bg.scrolled .topbar-logo {
    color: var(--text-primary);
}

.site-topbar.has-bg.scrolled .topbar-btn {
    color: var(--text-secondary);
}

.site-topbar.has-bg.scrolled .topbar-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.site-topbar.has-bg .topbar-logo {
    color: #ffffff;
}

.site-topbar.has-bg .topbar-btn {
    color: rgba(255, 255, 255, 0.9);
}

.site-topbar.has-bg .topbar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

[data-theme="dark"] .site-topbar.has-bg {
    background: transparent;
}

[data-theme="dark"] .site-topbar.has-bg.scrolled {
    background: var(--bg);
}

[data-theme="dark"] .site-topbar.has-bg .topbar-logo {
    color: #ffffff;
}

/* ================================
   文章列表
   ================================ */

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

.post-list {
    display: flex;
    flex-direction: column;
}

.post-item {
    position: relative;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s ease;
}

.post-item:last-child {
    border-bottom: none;
}

/* 整块可点击 */
.post-item-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.post-item .category-tag,
.post-item .post-item-meta span {
    position: relative;
    z-index: 2;
}

.post-item-top {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-item-top .category-tag {
    color: var(--text-secondary);
}

.post-item-top .category-tag:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.post-item-top .dot {
    color: var(--border);
}

.post-item-title {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.post-item-title a {
    color: var(--text-primary);
}

.post-item-title a:hover {
    color: var(--text-primary);
}

.post-item-excerpt {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-item-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    gap: 16px;
}

.post-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-item-meta i {
    font-size: 12px;
}

/* 置顶标签 */
/* 精选推荐（置顶）v6.23.0 卡片式优化 */
.featured-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 4px;
}

/* 置顶卡片与普通卡片样式一致，仅多置顶角标 */
.post-card-featured {
    /* 继承 .post-card 全部样式 */
}

.post-card-thumb-featured {
    /* 继承 .post-card-thumb 全部样式 */
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
    background: var(--text-primary);
    color: var(--bg);
    font-weight: 500;
    z-index: 3;
    opacity: 0.9;
}

.post-card-featured .post-card-title {
    /* 继承普通卡片样式 */
}

.post-card-featured .post-card-excerpt {
    /* 继承普通卡片样式 */
}

.post-card-featured .post-card-meta-top {
    /* 继承普通卡片样式 */
}

.post-card-featured .post-card-meta-bottom {
    /* 继承普通卡片样式 */
}

.posts-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0 20px;
}

/* ---------- 卡片式文章列表 ---------- */
.post-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    transition: all 0.15s ease;
    position: relative;
}

.post-card:hover {
    border-color: var(--text-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

/* 整个卡片可点击 */
.post-card-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* 卡片内其他链接层级更高，可独立点击 */
.post-card .category-tag,
.post-card .post-card-thumb {
    position: relative;
    z-index: 2;
}

.post-card-thumb {
    flex: 0 0 16%;
    max-width: 16%;
    border-radius: 2px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--hover-bg);
}

.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.15s ease;
}

.post-card:hover .post-card-thumb img {
    opacity: 0.85;
}

.post-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-card-meta-top {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-card-meta-top .category-tag {
    color: var(--text-secondary);
}

.post-card-meta-top .category-tag:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.post-card-meta-top .dot {
    color: var(--border);
}

.post-card-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.post-card-title a {
    color: var(--text-primary);
}

.post-card-title a:hover {
    color: var(--text-primary);
}

.post-card-excerpt {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta-bottom {
    font-size: 11px;
    color: var(--text-tertiary);
    display: flex;
    gap: 10px;
}

.post-card-meta-bottom span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.post-card-meta-bottom i {
    font-size: 11px;
}

/* ================================
   分页
   ================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.page-link {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.page-link:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    text-decoration: none;
}

.page-link.active {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

.page-link.disabled {
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

.page-ellipsis {
    color: var(--text-tertiary);
    padding: 0 4px;
}

/* ================================
   空状态
   ================================ */

.no-results {
    padding: 60px 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

.no-results i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ================================
   页面标题区
   ================================ */

.page-header {
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.search-header {
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.search-header h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

.search-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.search-header .keyword {
    color: var(--text-primary);
    font-weight: 500;
}

.search-highlight {
    background: #fff3b0;
    padding: 0 2px;
}

[data-theme="dark"] .search-highlight {
    background: #6b5e00;
    color: #fff;
}

/* ================================
   文章详情
   ================================ */

.article {
    padding: 8px 0;
}

.article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.article-title {
    font-size: 32px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 16px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.article-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.article-meta i {
    font-size: 12px;
}

.article-meta .meta-category {
    color: inherit;
}

.article-meta .meta-category:hover {
    color: var(--text-primary);
}

.article-category {
    font-size: 13px;
    margin-bottom: 12px;
}

.article-category a {
    color: var(--text-secondary);
}

.article-cover {
    margin-bottom: 32px;
    border-radius: 4px;
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    height: auto;
}

.article-content {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-primary);
    padding: 8px 0;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    /* v6.13.2：去掉裁切，改用真自适应 */
    overflow-x: visible;
    contain: none;
}

/* 终极防溢出：所有子元素最大宽度不超过容器（代码块内部除外） */
.article-content *:not(pre):not(pre *) {
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

/* p/span/div 等文本容器强制折行（排除 pre 内部） */
.article-content p,
.article-content div:not(.line-numbers):not(.code-copy-btn),
.article-content span:not(.line-numbers span),
.article-content li,
.article-content td,
.article-content th {
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal !important;
}

/* === 代码块专属保护：完全豁免溢出规则 === */
.article-content pre,
.article-content pre * {
    max-width: none !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
    word-break: normal !important;
    box-sizing: border-box;
}

.article-content pre code,
.article-content pre code * {
    white-space: pre !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
    word-break: normal !important;
}

/* 复制按钮绝对不受溢出规则影响 */
.article-content pre .code-copy-btn,
.article-content pre .code-copy-btn * {
    max-width: none !important;
    min-width: 0 !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
    word-break: normal !important;
    white-space: nowrap !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== 采集内容真自适应 v6.13.2 ===== */
/* 核心：全链路去掉裁切，让所有元素真正缩到容器宽度内 */
/* 三层容器已全部移除 overflow-x:hidden，此处确保内容不撑破 */

#articleContent {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: visible;
    display: block;
}

/* 所有子元素（含深层嵌套）：border-box + 最大宽度不超容器 + min-width:0允许flex收缩 */
#articleContent *:not(pre):not(pre *) {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* 图片强制自适应：大图压到容器宽，小图保持原样 */
#articleContent img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
}

/* a标签内的图片也同样生效 */
#articleContent a img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* figure/picture 包裹：不撑宽 */
#articleContent figure,
#articleContent picture {
    max-width: 100% !important;
    margin: 0;
    padding: 0;
    display: block;
}

/* table：固定布局+宽度100%+内部横向滚动 */
#articleContent table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}
#articleContent table td,
#articleContent table th {
    max-width: 100% !important;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* 代码块：最大宽度100%+横向滚动，内部不被限宽 */
#articleContent pre {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
#articleContent pre * {
    max-width: none !important;
    min-width: auto !important;
}

/* iframe/video 等嵌入：自适应宽度+保持比例 */
#articleContent iframe,
#articleContent video,
#articleContent embed,
#articleContent object {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    display: block;
}

/* 浮动元素清除，避免撑破容器 */
#articleContent::after {
    content: "";
    display: table;
    clear: both;
}

/* 浮动子元素：最大宽度不超容器 */
#articleContent [style*="float"]:not(pre):not(pre *) {
    max-width: 100% !important;
}

/* flex/grid 容器：允许换行+子元素收缩 */
#articleContent [style*="display:flex"]:not(pre):not(pre *),
#articleContent [style*="display: flex"]:not(pre):not(pre *) {
    flex-wrap: wrap !important;
    max-width: 100% !important;
}
#articleContent [style*="display:flex"]:not(pre):not(pre *) > *,
#articleContent [style*="display: flex"]:not(pre):not(pre *) > * {
    min-width: 0 !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
}

/* 绝对定位元素：限制在容器内（避免左右撑出） */
#articleContent [style*="position:absolute"]:not(pre):not(pre *),
#articleContent [style*="position: absolute"]:not(pre):not(pre *) {
    max-width: 100% !important;
    left: auto !important;
    right: auto !important;
}
.article-content figure {
    margin: 1em 0;
}

.article-content figure img {
    margin: 0;
}

.article-content figcaption {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 8px;
}

/* 文章内容溢出防护：所有媒体元素不超出容器 */
.article-content img,
.article-content video,
.article-content iframe,
.article-content svg,
.article-content canvas,
.article-content embed,
.article-content object {
    max-width: 100%;
    height: auto;
}

.article-content img {
    cursor: zoom-in;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.article-content img:hover {
    opacity: 0.9;
}

/* 图片灯箱 */
.img-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    cursor: zoom-out;
    padding: 20px;
    box-sizing: border-box;
}

.img-lightbox.active {
    display: flex;
}

.img-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.img-lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    user-select: none;
}

.img-lightbox-close:hover {
    opacity: 1;
}

/* 块级元素最大宽度限制 */
.article-content div,
.article-content section,
.article-content article,
.article-content aside {
    max-width: 100%;
}

/* 清除第一个子元素的上边距，修复HTML文章顶部空白 */
.article-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.article-content > p:empty,
.article-content > div:empty,
.article-content > br:first-child {
    display: none;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-weight: 500;
    line-height: 1.4;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    color: var(--text-primary);
}

.article-content h1 { font-size: 26px; }
.article-content h2 { font-size: 22px; }
.article-content h3 { font-size: 19px; }
.article-content h4 { font-size: 17px; }
.article-content h5 { font-size: 16px; }
.article-content h6 { font-size: 15px; }

.article-content p {
    margin-bottom: 1.2em;
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border);
    transition: text-decoration-color 0.15s ease;
}

.article-content a:hover {
    text-decoration-color: var(--primary);
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.2em;
    padding-left: 1.6em;
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li {
    margin-bottom: 0.4em;
}

.article-content blockquote {
    margin: 1.5em 0;
    padding: 0.8em 1.2em;
    border-left: 3px solid var(--border);
    background: var(--hover-bg);
    color: var(--text-secondary);
    font-size: 15px;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content code {
    font-family: "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    padding: 2px 6px;
    background: var(--code-bg);
    border-radius: 3px;
    color: var(--text-primary);
}

.article-content pre {
    position: relative;
    margin: 1.5em 0;
    padding: 16px 0;
    padding-right: 50px;
    background: var(--code-bg);
    border-radius: 6px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.6;
    max-width: 100%;
    display: flex;
}

/* 行号列 */
.article-content pre .line-numbers {
    flex-shrink: 0;
    padding: 0 12px 0 16px;
    text-align: right;
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1.6;
    user-select: none;
    border-right: 1px solid var(--border);
    margin-right: 16px;
    overflow: hidden;
    font-family: "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.article-content pre .line-numbers span {
    display: block;
    height: 1.6em;
    line-height: 1.6em;
}

/* 代码区域可横向滚动 */
.article-content pre code,
.article-content pre code.hljs {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: block;
    padding: 0 8px 0 0 !important;
    word-wrap: normal;
    white-space: pre;
    min-width: 0;
    scrollbar-width: thin;
    background: transparent !important;
}

/* 没有行号时恢复原样 */
.article-content pre:not(.has-line-numbers) {
    padding: 16px;
    padding-right: 50px;
    display: block;
    overflow-x: auto;
}

.article-content pre:not(.has-line-numbers) code {
    padding: 0;
    overflow: visible;
}

/* 代码块复制按钮 */
.article-content pre .code-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    opacity: 1;
    transition: color 0.2s, border-color 0.2s;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.article-content pre .code-copy-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.article-content pre .code-copy-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.article-content pre .code-copy-btn.copied {
    color: #22c55e;
    border-color: #22c55e;
}

/* 桌面端 hover 才显示，手机端常显 */
@media (min-width: 769px) {
    .article-content pre .code-copy-btn {
        opacity: 0;
        transition: opacity 0.2s, color 0.2s, border-color 0.2s;
    }
    .article-content pre:hover .code-copy-btn {
        opacity: 1;
    }
    .article-content pre .code-copy-btn.copied {
        opacity: 1;
    }
}

.article-content pre code {
    padding: 0;
    background: none;
    font-size: inherit;
    white-space: pre;
    word-wrap: normal;
}

.article-content img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    border-radius: 4px;
    margin: 1em 0;
    display: block;
}

.article-content .article-table-wrap {
    overflow-x: auto;
    margin: 1.5em 0;
}

.article-content table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.article-content th,
.article-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

.article-content th {
    background: var(--hover-bg);
    font-weight: 500;
}

.article-content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2em 0;
}

/* 暗色模式下文章内容跟随主题 */
[data-theme="dark"] .article-content {
    background: transparent;
    color: var(--text-primary);
}

[data-theme="dark"] .article-content h1,
[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4,
[data-theme="dark"] .article-content h5,
[data-theme="dark"] .article-content h6 {
    color: var(--text-primary);
}

[data-theme="dark"] .article-content p,
[data-theme="dark"] .article-content li {
    color: var(--text-primary);
}

[data-theme="dark"] .article-content a {
    color: var(--primary);
}

[data-theme="dark"] .article-content blockquote {
    background: var(--hover-bg);
    color: var(--text-secondary);
    border-left-color: var(--border);
}

[data-theme="dark"] .article-content code {
    background: var(--hover-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .article-content pre {
    background: var(--hover-bg);
}

[data-theme="dark"] .article-content th,
[data-theme="dark"] .article-content td {
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .article-content th {
    background: var(--hover-bg);
}

[data-theme="dark"] .article-content hr {
    background: var(--border);
}

/* 文章版权声明 */
.article-copyright {
    margin-top: 32px;
    padding: 16px 20px;
    background: var(--hover-bg);
    border-left: 3px solid var(--primary);
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.9;
}

.copyright-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.copyright-label {
    flex-shrink: 0;
    color: var(--text-tertiary);
    font-weight: 500;
}

.copyright-value {
    flex: 1;
    min-width: 0;
    color: var(--text-secondary);
    word-break: break-all;
}

.copyright-value a {
    color: var(--primary);
}

.copyright-url {
    position: relative;
    cursor: pointer;
    font-family: monospace;
    font-size: 12.5px;
    transition: color 0.15s ease;
}

.copyright-url:hover {
    color: var(--primary);
}

.copyright-url .copy-tip {
    position: absolute;
    right: 0;
    top: -2px;
    font-size: 11px;
    color: var(--text-tertiary);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid var(--border);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    font-family: inherit;
}

.copyright-url:hover .copy-tip {
    opacity: 1;
}

.copyright-url.copied .copy-tip {
    opacity: 1;
    color: #52c41a;
    border-color: #52c41a;
}

@media (max-width: 640px) {
    .article-copyright {
        padding: 12px 14px;
        font-size: 12.5px;
    }
    .copyright-url .copy-tip {
        display: none;
    }
}

/* 文章底部 */
.article-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.article-tags a {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.article-tags a:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    text-decoration: none;
}

.article-actions {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.article-actions button {
    padding: 10px 24px;
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-actions button:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.article-actions button.liked {
    color: #ef4444;
    border-color: #ef4444;
}

/* 上下篇导航 v6.14.0 优化 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.post-nav-item {
    flex: 1;
    font-size: 14px;
}

.post-nav-item a {
    display: block;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    text-decoration: none;
    background: var(--bg);
}

.post-nav-item a:hover {
    border-color: var(--text-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.post-nav-item.next a {
    text-align: right;
}

.post-nav-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-nav-item.next .post-nav-label {
    justify-content: flex-end;
}

.post-nav-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

/* ================================
   评论区
   ================================ */

.comments-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.comments-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 24px;
}

.comment-form {
    margin-bottom: 36px;
}

.comment-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--text-secondary);
}

.comment-form textarea {
    min-height: 100px;
    resize: vertical;
    margin-bottom: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--text-secondary);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

.btn-primary:hover {
    opacity: 0.85;
}

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

[data-theme="dark"] .alert-success {
    background: #052e16;
    color: #86efac;
    border-color: #166534;
}

[data-theme="dark"] .alert-error {
    background: #450a0a;
    color: #fca5a5;
    border-color: #991b1b;
}

/* 评论列表 */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-item {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-head {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.comment-info {
    flex: 1;
}

.comment-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.comment-meta-row {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    gap: 12px;
}

.comment-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-left: 48px;
    word-break: break-word;
}

.comment-footer {
    margin-left: 48px;
    margin-top: 8px;
}

.comment-footer a {
    font-size: 12px;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.comment-footer a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

/* 回复 */
.comment-reply {
    margin-left: 48px;
    margin-top: 16px;
    padding-left: 16px;
    border-left: 2px solid var(--border);
}

.comment-reply .comment-item {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: none;
}

.comment-reply .comment-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.comment-reply .comment-body {
    margin-left: 40px;
    font-size: 13px;
}

.comment-reply .comment-footer {
    margin-left: 40px;
}

/* ================================
   归档页
   ================================ */

.archive-year-title {
    font-size: 18px;
    font-weight: 500;
    margin: 32px 0 16px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.archive-year-title:first-child {
    margin-top: 0;
}

.archive-month-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 20px 0 12px;
    padding-left: 4px;
}

.archive-item-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 8px 0;
    padding-left: 12px;
    border-bottom: 1px solid var(--border);
}

.archive-item-row:last-child {
    border-bottom: none;
}

.archive-item-row a {
    color: var(--text-primary);
    font-size: 15px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-item-row a:hover {
    color: var(--text-primary);
}

.archive-item-row .date {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-left: 16px;
    flex-shrink: 0;
}

/* ================================
   友情链接
   ================================ */

.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.link-card:hover {
    border-color: var(--text-secondary);
    text-decoration: none;
}

.link-logo {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.link-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.link-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hover-bg);
    color: var(--text-tertiary);
    font-size: 16px;
    border-radius: 4px;
}

.link-card img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: cover;
}

.link-card-info {
    flex: 1;
    min-width: 0;
}

.link-card-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 首页友情链接 */
.home-links {
    margin-top: auto;
    padding-top: 32px;
    padding-bottom: 24px;
    border-top: 1px solid var(--border);
}

/* 首页友链区标题 flex 布局：标题左，按钮右 */
.home-links .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.home-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.home-link-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.home-link-item:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    text-decoration: none;
}

.home-link-item img {
    width: 18px;
    height: 18px;
    border-radius: 2px;
}

.link-icon {
    font-size: 12px;
}

/* ================================
   说说
   ================================ */

.shuoshuo-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ss-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.ss-item:last-child {
    border-bottom: none;
}

.ss-content {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-primary);
    margin-bottom: 10px;
    word-break: break-word;
}

.ss-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    gap: 16px;
}

.ss-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ================================
   分类浏览模块
   ================================ */

.category-posts-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.category-posts-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.category-posts-tabs::-webkit-scrollbar {
    display: none;
}

.category-posts-tab {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    background: none;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.category-posts-tab:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.category-posts-tab.active {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

.category-posts-panel {
    display: none;
}

.category-posts-panel.active {
    display: block;
}

.category-post-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.category-post-empty {
    grid-column: 1 / -1;
    padding: 40px 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.category-post-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.category-post-item:hover {
    border-color: var(--text-secondary);
    text-decoration: none;
}

.cp-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
}

.cp-info {
    flex: 1;
    min-width: 0;
}

.cp-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.cp-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    display: flex;
    gap: 12px;
}

.cp-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.category-posts-more {
    margin-top: 20px;
    text-align: center;
}

.category-posts-more a {
    display: inline-block;
    padding: 8px 24px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.category-posts-more a:hover {
    color: var(--text-primary);
    border-color: var(--text-tertiary);
    background: var(--hover-bg);
}

/* ================================
   底部
   ================================ */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    font-size: 13px;
    color: var(--text-tertiary);
    transition: border-color 0.2s ease;
}

.footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding-x);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.site-footer a {
    color: var(--text-secondary);
}

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

.footer-custom {
    font-size: 12.5px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.footer-custom a {
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 16px;
}

/* 底部友链区 */
.footer-links-section {
    width: 100%;
    padding: 16px 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.footer-links-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.footer-links-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links-apply {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-links-apply:hover {
    color: var(--text-primary);
}

.footer-links-apply .icon {
    width: 12px;
    height: 12px;
}

.footer-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    justify-content: flex-start;
}

.footer-link-item {
    font-size: 12.5px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.footer-link-item:hover {
    color: var(--text-primary);
}

.footer-link-more {
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-links-empty {
    text-align: center;
    font-size: 12.5px;
    color: var(--text-tertiary);
    padding: 4px 0;
}

.footer-links-empty a {
    color: var(--text-secondary);
}

/* ================================
   关于页
   ================================ */

.about-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 500;
    color: var(--text-secondary);
}

.about-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-header {
    text-align: center;
    margin-bottom: 40px;
}

.about-header h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

.about-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ================================
   代码高亮
   ================================ */

.hljs {
    background: var(--code-bg) !important;
}

/* ================================
   分类列表页
   ================================ */

.category-list-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.category-card {
    display: block;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.category-card:hover {
    border-color: var(--text-secondary);
    text-decoration: none;
}

.category-card .cat-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.category-card .cat-count {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.category-card .cat-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ================================
   过渡动画
   ================================ */

body,
.post-item,
.btn,
.page-link,
.search-form,
.link-card,
.category-post-item {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ========================================
   响应式 — 平板端 (769px ~ 1023px)
   ======================================== */

@media (max-width: 1023px) {
    :root {
        --drawer-width: 300px;
    }
}

/* ========================================
   响应式 — 移动端 (≤768px)
   ======================================== */

@media (max-width: 768px) {
    :root {
        --drawer-width: 280px;
        --content-padding-x: 20px;
    }

    /* 顶部栏调整 */
    .topbar-inner {
        padding: 0 var(--content-padding-x);
    }

    .topbar-btn {
        width: 36px;
        height: 36px;
    }

    .hamburger-icon {
        font-size: 18px;
    }

    .topbar-logo {
        font-size: 15px;
    }

    .topbar-logo img {
        height: 30px;
        max-width: 140px;
    }

    /* 内容区 */
    .content-wrapper {
        padding: 20px var(--content-padding-x) 48px;
    }

    /* 移动端：侧边栏改单列布局 */
    .main-layout {
        flex-direction: column;
        gap: 24px;
        /* v6.13.2：移动端stretch，确保子元素宽度填满 */
        align-items: stretch;
    }

    .site-sidebar {
        width: 100%;
        position: static;
        order: 2;
    }

    .main-content {
        order: 1;
        /* v6.13.2：确保宽度100%，不被内容撑宽 */
        width: 100%;
        max-width: 100%;
    }

    /* 移动端侧边栏widget两列布局 */
    .tag-cloud {
        justify-content: flex-start;
    }

    /* 卡片式文章列表 - 移动端左右布局 */
    .post-card {
        flex-direction: row;
        gap: 8px;
        padding: 6px;
    }

    .post-card-thumb {
        flex: 0 0 28%;
        max-width: 28%;
        aspect-ratio: 4 / 3;
    }

    .post-card-title {
        font-size: 13px;
    }

    .post-card-excerpt {
        display: none;
    }

    .post-card-meta-bottom {
        font-size: 10px;
        gap: 8px;
    }

    .post-card-meta-top {
        font-size: 10px;
        margin-bottom: 2px;
    }

    /* 精选置顶卡片 - 移动端（与普通卡片一致，仅角标） */
    .post-card-thumb-featured {
        /* 继承普通卡片移动端样式 */
    }

    .featured-badge {
        font-size: 9px;
        padding: 1px 4px;
        top: 4px;
        left: 4px;
    }

    /* 文章列表 */
    .post-item-title {
        font-size: 18px;
    }

    .post-item-excerpt {
        -webkit-line-clamp: 3;
    }

    /* 文章详情 */
    .article-title {
        font-size: 24px;
    }

    .hero-section h1 {
        font-size: 24px;
    }

    .hero-with-bg {
        padding: 16px var(--content-padding-x);
        margin: 0 calc(-1 * var(--content-padding-x)) 16px;
    }

    .hero-bg-layer {
        height: 230px;
    }

    .hero-with-bg h1 {
        font-size: 22px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    /* 友链 */
    .links-grid {
        grid-template-columns: 1fr;
    }

    .category-post-list {
        grid-template-columns: 1fr;
    }

    .category-list-page {
        grid-template-columns: 1fr;
    }

    .comment-form-row {
        flex-direction: column;
    }

    .comment-body {
        margin-left: 44px;
    }

    .comment-footer {
        margin-left: 44px;
    }

    .comment-reply {
        margin-left: 24px;
    }

    .post-navigation {
        flex-direction: column;
        gap: 12px;
    }

    .post-nav-item.next a {
        text-align: left;
    }

    .post-nav-item.next .post-nav-label {
        justify-content: flex-start;
    }

    .footer-inner {
        padding: 0 var(--content-padding-x);
        flex-direction: column;
        text-align: center;
    }

    /* 抽屉内部更紧凑 */
    .drawer-body {
        padding: 16px;
        gap: 20px;
    }

    .drawer-widget {
        padding-bottom: 20px;
    }

    .drawer-tag-cloud a {
        padding: 2px 2px;
    }
}

/* ========================================
   桌面端优化 (≥1024px)
   ======================================== */

@media (min-width: 1024px) {
    :root {
        --drawer-width: 320px;
    }
}

/* ========================================
   友情链接模块样式 v6.6.2
   ======================================== */

/* 右抽屉友链 */
.drawer-widget-more {
    float: right;
    font-size: 12px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-weight: normal;
}
.drawer-widget-more:hover {
    color: var(--primary);
}

.drawer-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.drawer-link-list li {
    flex: 0 0 calc(50% - 4px);
}
.drawer-link-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all .2s;
    background: var(--hover-bg);
}
.drawer-link-list a:hover {
    background: var(--primary);
    color: #fff;
}
.drawer-link-logo {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}
.drawer-link-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drawer-link-apply {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.drawer-link-apply a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    transition: opacity .2s;
}
.drawer-link-apply a:hover {
    opacity: 0.9;
}

/* 侧边栏友链 */
.widget-more {
    float: right;
    font-size: 12px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-weight: normal;
}
.widget-more:hover {
    color: var(--primary);
}

.link-widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.link-widget-list li {
    flex: 0 0 calc(50% - 3px);
}
.link-widget-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all .2s;
    background: var(--hover-bg);
}
.link-widget-list a:hover {
    background: var(--primary);
    color: #fff;
}
.link-widget-logo {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}
.link-widget-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}
.link-widget-apply {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.link-widget-apply a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 12.5px;
    text-decoration: none;
    transition: opacity .2s;
}
.link-widget-apply a:hover {
    opacity: 0.9;
}

/* 前台友链页申请表单 */
.link-apply-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.link-apply-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
}
.link-apply-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.link-apply-title i {
    color: var(--primary);
    font-size: 22px;
}
.apply-success {
    text-align: center;
    padding: 20px 0;
}
.apply-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f6ffed;
    color: #52c41a;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.apply-success h4 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}
.apply-success p {
    font-size: 14px;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin: 0 0 24px 0;
}
.apply-error {
    padding: 12px 16px;
    background: #fff1f0;
    border: 1px solid #ffa39e;
    border-radius: 8px;
    color: #cf1322;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 640px) {
    .link-apply-card {
        padding: 24px 20px;
    }
    .drawer-link-list li {
        flex: 0 0 100%;
    }
}

/* ========================================
   v6.6.7 — 首页申请友链弹窗 + 按钮（极简黑白灰）
   ======================================== */

/* 首页友链区申请按钮 */
.home-link-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: none;
    letter-spacing: 0;
    flex-shrink: 0;
}
.home-link-apply-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}
.home-link-apply-btn i {
    font-size: 12px;
}

/* 申请友链弹窗遮罩 */
.link-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 20px;
    box-sizing: border-box;
}
.link-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器 */
.link-modal {
    background: var(--bg);
    border-radius: 6px;
    width: 100%;
    max-width: 420px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(10px);
    transition: transform 0.2s ease;
    border: 1px solid var(--border);
}
.link-modal-overlay.show .link-modal {
    transform: translateY(0);
}

/* 弹窗头部 */
.link-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 1;
}
.link-modal-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.link-modal-title i {
    color: var(--text-secondary);
    font-size: 16px;
}
.link-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.link-modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* 弹窗内容 */
.link-modal-body {
    padding: 12px 16px 16px;
}

/* 表单通用 */
.link-modal .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.link-modal .form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}
.link-modal .form-group {
    margin-bottom: 10px;
}
.link-modal .form-label {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.link-modal .form-label.required::after {
    content: '*';
    color: var(--text-primary);
    margin-left: 3px;
}
.link-modal .form-control {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg);
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}
.link-modal .form-control:focus {
    outline: none;
    border-color: var(--text-secondary);
}
.link-modal .form-control::placeholder {
    color: var(--text-tertiary);
}
.link-modal textarea.form-control {
    resize: vertical;
    min-height: 40px;
    font-family: inherit;
}

/* 验证码 */
.link-modal .captcha-group .captcha-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}
.link-modal .captcha-question {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--hover-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: all 0.15s ease;
}
.link-modal .captcha-question:hover {
    border-color: var(--text-tertiary);
}
.link-modal .captcha-refresh {
    font-size: 12px;
    color: var(--text-tertiary);
}
.link-modal .captcha-input {
    flex: 1;
    max-width: 120px;
}

/* 提示文案 */
.link-modal .apply-tips {
    margin: 10px 0;
    padding: 6px 10px;
    background: var(--hover-bg);
    border-radius: 4px;
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: flex;
    gap: 5px;
}
.link-modal .apply-tips i {
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 13px;
}

/* 按钮 */
.link-modal .btn-block {
    width: 100%;
    justify-content: center;
    padding: 9px 16px;
    font-size: 13px;
}
.link-modal .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1px solid var(--text-primary);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.link-modal .btn-primary {
    background: var(--text-primary);
    color: var(--bg);
}
.link-modal .btn-primary:hover {
    opacity: 0.85;
}
.link-modal .btn-primary:active {
    opacity: 1;
}
.link-modal .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 成功状态 */
.link-modal .apply-success {
    text-align: center;
    padding: 12px 0 4px;
}
.link-modal .apply-success-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--hover-bg);
    color: var(--text-primary);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    border: 1px solid var(--border);
}
.link-modal .apply-success h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}
.link-modal .apply-success p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 16px 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .link-modal {
        max-width: 90%;
    }
    .link-modal-header {
        padding: 14px 16px;
    }
    .link-modal-body {
        padding: 16px;
    }
    .link-modal .form-row {
        flex-direction: column;
        gap: 12px;
    }
    .link-modal .captcha-group .captcha-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .link-modal .captcha-input {
        max-width: none;
        width: 100%;
    }
}

/* 暗色模式代码高亮主题（GitHub Dark 风格） */
[data-theme="dark"] .article-content pre code.hljs {
    color: #c9d1d9;
    background: transparent;
}

[data-theme="dark"] .article-content .hljs-doctag,
[data-theme="dark"] .article-content .hljs-keyword,
[data-theme="dark"] .article-content .hljs-meta .hljs-keyword,
[data-theme="dark"] .article-content .hljs-template-tag,
[data-theme="dark"] .article-content .hljs-template-variable,
[data-theme="dark"] .article-content .hljs-type,
[data-theme="dark"] .article-content .hljs-variable.language_ {
    color: #ff7b72;
}

[data-theme="dark"] .article-content .hljs-title,
[data-theme="dark"] .article-content .hljs-title.class_,
[data-theme="dark"] .article-content .hljs-title.class_.inherited__,
[data-theme="dark"] .article-content .hljs-title.function_ {
    color: #d2a8ff;
}

[data-theme="dark"] .article-content .hljs-attr,
[data-theme="dark"] .article-content .hljs-attribute,
[data-theme="dark"] .article-content .hljs-literal,
[data-theme="dark"] .article-content .hljs-meta,
[data-theme="dark"] .article-content .hljs-number,
[data-theme="dark"] .article-content .hljs-operator,
[data-theme="dark"] .article-content .hljs-selector-attr,
[data-theme="dark"] .article-content .hljs-selector-class,
[data-theme="dark"] .article-content .hljs-selector-id,
[data-theme="dark"] .article-content .hljs-variable {
    color: #79c0ff;
}

[data-theme="dark"] .article-content .hljs-meta .hljs-string,
[data-theme="dark"] .article-content .hljs-regexp,
[data-theme="dark"] .article-content .hljs-string {
    color: #a5d6ff;
}

[data-theme="dark"] .article-content .hljs-built_in,
[data-theme="dark"] .article-content .hljs-symbol {
    color: #ffa657;
}

[data-theme="dark"] .article-content .hljs-code,
[data-theme="dark"] .article-content .hljs-comment,
[data-theme="dark"] .article-content .hljs-formula {
    color: #8b949e;
}

[data-theme="dark"] .article-content .hljs-name,
[data-theme="dark"] .article-content .hljs-quote,
[data-theme="dark"] .article-content .hljs-selector-pseudo,
[data-theme="dark"] .article-content .hljs-selector-tag {
    color: #7ee787;
}

[data-theme="dark"] .article-content .hljs-subst {
    color: #c9d1d9;
}

[data-theme="dark"] .article-content .hljs-section {
    color: #1f6feb;
    font-weight: 700;
}

[data-theme="dark"] .article-content .hljs-bullet {
    color: #f2cc60;
}

[data-theme="dark"] .article-content .hljs-emphasis {
    color: #c9d1d9;
    font-style: italic;
}

[data-theme="dark"] .article-content .hljs-strong {
    color: #c9d1d9;
    font-weight: 700;
}

[data-theme="dark"] .article-content .hljs-addition {
    color: #7ee787;
    background-color: rgba(46, 160, 67, 0.15);
}

[data-theme="dark"] .article-content .hljs-deletion {
    color: #ff7b72;
    background-color: rgba(248, 81, 73, 0.15);
}
