/*
Theme Name: ddof Blog
Theme URI: #
Author: ddof
Author URI: #
Description: A modern WordPress theme by Claude 3.5 Sonnet
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ddof Blog
*/

/* 全局变量 */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #666;
    --accent-color: #2563eb;
    --background-color: #f5f5f5;
    --content-bg: #fff;
    --text-color: #333;
    --link-color: #2563eb;
    --border-color: #eaeaea;
    --category-bg: #eef3ff;
    --category-color: #2563eb;
    --header-bg: #fff;
    --title-color: #1a1a1a;
    --excerpt-color: #555;
}

/* 暗色模式变量 */
[data-theme="dark"] {
    --primary-color: #f0f0f0;
    --secondary-color: #aaa;
    --accent-color: #60a5fa;
    --background-color: #121212;
    --content-bg: #1e1e1e;
    --text-color: #d5d5d5;
    --link-color: #60a5fa;
    --border-color: #333;
    --category-bg: #2a2a2a;
    --category-color: #90a8e6;
    --header-bg: #1e1e1e;
    --title-color: #f0f0f0;
    --excerpt-color: #a9a9a9;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    font-size: 14px;
    transition: background-color 0.5s ease, color 0.5s ease;
}

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

a:hover {
    opacity: 0.8;
}

/* 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.site-header {
    background-color: var(--header-bg);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.site-title a {
    color: inherit;
}

/* 导航样式 */
.main-navigation {
    flex: 1;
    margin: 0 30px;
}

.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu a {
    color: var(--text-color);
    font-size: 14px;
    padding: 5px 0;
}

.nav-menu a:hover {
    color: #ff6b6b;
}

/* 头部右侧区域 */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 搜索框样式 */
.search-form {
    display: flex;
    align-items: center;
}

.search-field {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    background-color: var(--content-bg);
    color: var(--text-color);
}

.search-submit {
    padding: 6px 12px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
}

/* 暗色模式切换按钮（单按钮圆钮） */
.theme-switch-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-switch-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--content-bg);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.theme-switch-icon i {
    font-style: normal;
    line-height: 1;
}

.theme-switch-icon svg {
    width: 17px;
    height: 17px;
    display: block;
}

.theme-switch-icon:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.theme-switch-icon:active {
    transform: scale(0.92);
}

[data-theme="dark"] .theme-switch-icon {
    color: #ffd27f;
    border-color: #444;
    background: #2a2a2a;
}

/* 添加全局过渡效果 */
html {
    transition: background-color 0.5s ease, color 0.5s ease;
}

body {
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* 内容区域 */
.content-wrapper {
    display: flex;
    gap: 30px;
    padding: 20px 0;
}

.content-area {
    flex: 1;
    background: var(--content-bg);
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

/* 首页文章列表样式 */
.post-item {
    display: flex;
    gap: 20px;
    padding: 18px 6px;
    border-bottom: 1px solid var(--border-color);
    border-radius: 6px;
    transition: background-color 0.25s ease;
}

.post-item:hover {
    background: var(--background-color);
}

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

.post-item .post-thumbnail {
    flex: 0 0 246px;
    height: 153.75px;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}

.post-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.post-item .post-thumbnail:hover img {
    transform: scale(1.06);
}

.post-item .post-content {
    flex: 1;
}

.post-item .post-title {
    font-size: 20px;
    margin: 10px 0;
    line-height: 1.4;
    font-weight: 500;
}

.post-item .post-title a {
    color: var(--title-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.post-item .post-excerpt {
    color: var(--excerpt-color);
    margin-bottom: 15px;
    line-height: 1.7;
}

.post-item .post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--secondary-color);
    font-size: 14px;
}

.post-item .post-meta .category-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--category-bg);
    color: var(--category-color);
    font-size: 12px;
    border-radius: 3px;
}

.post-item .post-meta .post-time {
    color: var(--secondary-color);
}

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

/* 首页侧边栏样式 */
.widget-post-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.widget-post-thumbnail {
    flex: 0 0 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
}

.widget-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.widget-post-content {
    flex: 1;
}

.widget-post-content h4 {
    font-size: 14px;
    margin: 0 0 5px;
    line-height: 1.4;
}

.widget-post-content h4 a {
    color: var(--text-color);
    text-decoration: none;
}

.widget-post-content h4 a:hover {
    color: var(--accent-color);
}

.widget-post-date {
    font-size: 12px;
    color: var(--secondary-color);
}

/* 侧边栏样式 */
.widget-area {
    flex: 0 0 300px;
    background: var(--content-bg);
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.widget {
    background: var(--content-bg);
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

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

.widget-title {
    position: relative;
    color: var(--title-color);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
    padding: 0 0 10px 11px;
    border-bottom: 2px solid var(--border-color);
}

.widget-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 4px;
    height: 14px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* 小工具内容样式 */
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.widget a {
    color: var(--text-color);
    text-decoration: none;
}

.widget a:hover {
    color: var(--accent-color);
}

/* 标签云小工具 */
.widget_tag_cloud .tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.widget_tag_cloud .tag-cloud-link {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px !important;
    background: var(--category-bg);
    color: var(--category-color);
    border-radius: 3px;
    text-decoration: none;
}

.widget_tag_cloud .tag-cloud-link:hover {
    background: var(--accent-color);
    color: #fff;
}

/* 日历小工具 */
.widget_calendar table {
    width: 100%;
    text-align: center;
}

.widget_calendar caption {
    margin-bottom: 10px;
    font-weight: bold;
}

.widget_calendar th,
.widget_calendar td {
    padding: 5px;
}

.widget_calendar #today {
    background: var(--category-bg);
    border-radius: 3px;
}

/* 搜索小工具 */
.widget_search .search-form {
    display: flex;
    gap: 10px;
}

.widget_search .search-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--content-bg);
    color: var(--text-color);
}

.widget_search .search-submit {
    padding: 8px 15px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.widget_search .search-submit:hover {
    opacity: 0.9;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .widget-area {
        flex: 0 0 100%;
        margin-top: 30px;
    }
    
    .content-wrapper {
        flex-direction: column;
    }

    .post-item .post-thumbnail {
        flex: 0 0 180px;
        height: 112.5px; /* 180 * 0.625 = 112.5 */
    }
}

/* 文章内容页样式 */
.single-content {
    padding: 30px;
    max-width: 840px;
    margin: 0 auto;
    background-color: var(--content-bg);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

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

.entry-title {
    font-size: 32px;
    margin: 15px 0;
    color: var(--title-color);
    line-height: 1.4;
    font-weight: normal;
}

.entry-meta {
    color: var(--secondary-color);
    font-size: 14px;
    margin: 15px 0;
}

.entry-meta span {
    margin: 0 10px;
    display: inline-block;
}

.entry-meta .category-tag {
    background: var(--category-bg);
    color: var(--category-color);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 100%;
    overflow: hidden;
}

.entry-content p {
    margin-bottom: 25px;
}

.entry-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 25px auto;
    border-radius: 8px;
    box-sizing: border-box;
}

.entry-content a {
    color: var(--accent-color);
    border-bottom: 1px solid var(--accent-color);
    text-decoration: none;
}

.entry-content a:hover {
    opacity: 0.8;
}

/* 文章页脚 */
.entry-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* 标签样式 */
.post-tags {
    margin: 30px 0;
    text-align: center;
}

.tag-link {
    display: inline-block;
    margin: 0 5px;
    padding: 3px 10px;
    color: var(--secondary-color);
    font-size: 14px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.tag-link:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* 文章导航 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-previous,
.nav-next {
    flex: 0 0 45%;
}

.nav-next {
    text-align: right;
}

.nav-subtitle {
    display: block;
    font-size: 13px;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.post-navigation a {
    color: var(--text-color);
    font-size: 15px;
    text-decoration: none;
    line-height: 1.4;
}

.post-navigation a:hover {
    color: var(--accent-color);
}

/* 评论区样式 */
.comments-area {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 22px;
    margin-bottom: 30px;
    color: var(--text-color);
    font-weight: normal;
    text-align: center;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    position: relative;
    z-index: 100;
    flex: 0 0 auto;
}

.menu-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 2px;
    margin: -1px 0 0 -11px;
    background: var(--text-color);
    border-radius: 2px;
    transition: background 0.3s ease;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: top 0.3s ease, transform 0.3s ease;
}

.menu-icon::before {
    top: -6px;
}

.menu-icon::after {
    top: 6px;
}

.menu-toggle.active .menu-icon {
    background: transparent;
}

.menu-toggle.active .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* 移动端工具栏 */
.mobile-header-tools {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.desktop-only {
    display: flex;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .single-content {
        padding: 20px;
    }

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

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

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

    .nav-previous,
    .nav-next {
        flex: 0 0 100%;
        text-align: left;
    }

    .post-item img {
        max-width: 90%;
        margin: 0 auto;
    }

    .entry-content img {
        max-width: 90% !important;
    }
}

/* 友情链接样式（简洁通用，无边框卡片、无图标） */
.friend-links {
    margin: 20px 0;
    padding: 20px;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.friend-links-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.friend-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.friend-links-list li {
    line-height: 1.6;
}

.friend-links-list a {
    display: inline-block;
    font-size: 14px;
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.friend-links-list a:hover {
    color: var(--accent-color);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .content-wrapper {
        flex-direction: column;
    }

    .widget-area {
        flex: 0 0 auto;
    }

    .post-item {
        flex-direction: column;
    }

    .post-thumbnail {
        flex: 0 0 auto;
        height: 200px;
    }

    .header-container {
        padding: 10px 0;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
        width: 38px;
        height: 38px;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--content-bg);
        padding: 64px 24px 30px;
        z-index: 99;
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
    }

    .main-navigation.active {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    .nav-menu li {
        margin: 0;
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 11px 8px;
        font-size: 16px;
        font-weight: 500;
        border-radius: 6px;
        transition: background 0.25s ease, color 0.25s ease;
    }

    .nav-menu a:hover {
        background: var(--background-color);
        color: var(--accent-color);
    }

    /* 头部右侧区域（移动端隐藏） */
    .header-right {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 15px;
        background: var(--content-bg);
        border-top: 1px solid var(--border-color);
    }

    .header-right.active {
        display: block;
    }

    .theme-switch-wrapper {
        justify-content: center;
    }

    .widget-area {
        margin-top: 30px;
    }

    .desktop-only {
        display: none;
    }

    .mobile-header-tools {
        display: block;
        margin-top: 10px;
        padding: 18px 0 0;
        border-top: 1px solid var(--border-color);
    }

    .mobile-header-tools .search-form {
        margin-bottom: 20px;
    }

    .mobile-header-tools .search-field {
        width: 100%;
    }

    .mobile-header-tools .theme-switch-wrapper {
        display: flex;
        justify-content: center;
    }

    .entry-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .entry-meta span {
        margin: 0;
    }
}

/* Footer 样式 */
.site-footer {
    background-color: var(--content-bg);
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.footer-content {
    text-align: center;
    color: var(--secondary-color);
    font-size: 14px;
}

.footer-content a {
    color: var(--link-color);
    text-decoration: none;
}

.footer-content a:hover {
    opacity: 0.8;
}

/* ====== 分页组件：居中 + 圆角页码 ====== */
.navigation.pagination {
    display: flex;
    justify-content: center;
    margin: 28px 0 10px;
}
.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.pagination .page-numbers {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    background: var(--content-bg);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
}
.pagination .page-numbers:not(.current):hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.pagination .page-numbers.current {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    font-weight: 600;
}
.pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: var(--secondary-color);
}

/* ====== 侧边栏 block 最新文章（含特色图） ====== */
.wp-block-latest-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget-area .wp-block-latest-posts li {
    overflow: hidden;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.widget-area .wp-block-latest-posts li:first-child {
    padding-top: 2px;
}
.widget-area .wp-block-latest-posts li:last-child {
    padding-bottom: 4px;
    border-bottom: none;
}
.widget-area .wp-block-latest-posts__featured-image {
    float: left;
    width: 92px;
    height: 69px;
    margin: 2px 12px 4px 0;
    overflow: hidden;
    border-radius: 4px;
}
.widget-area .wp-block-latest-posts__featured-image a {
    display: block;
    width: 100%;
    height: 100%;
}
.widget-area .wp-block-latest-posts__featured-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.widget-area .wp-block-latest-posts li:hover .wp-block-latest-posts__featured-image img {
    transform: scale(1.05);
}
.widget-area .wp-block-latest-posts__post-title {
    font-size: 14px;
    line-height: 1.45;
    color: var(--title-color);
    font-weight: 500;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.widget-area .wp-block-latest-posts__post-title:hover {
    color: var(--accent-color);
}
.widget-area .wp-block-latest-posts__post-date {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--secondary-color);
}

/* ====== block 搜索框（含暗夜适配） ====== */
.wp-block-search__inside-form {
    display: flex;
    gap: 8px;
}
.wp-block-search input[type="search"],
.wp-block-search__input {
    background: var(--content-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}
.wp-block-search__button {
    padding: 8px 16px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.25s ease;
    white-space: nowrap;
}
.wp-block-search__button:hover {
    opacity: 0.88;
}
[data-theme="dark"] .wp-block-search__input {
    background: #2a2a2a;
    color: #e6e6e6;
    border-color: #444;
    -webkit-text-fill-color: #e6e6e6;
    -webkit-box-shadow: 0 0 0 30px #2a2a2a inset;
}
[data-theme="dark"] .wp-block-search__input::placeholder {
    color: #888;
}

/* ====== 移动端细节优化 ====== */
@media (max-width: 768px) {
    .site-header {
        padding: 10px 0;
    }
    .header-container {
        padding: 8px 0;
    }
    .site-title {
        font-size: 20px;
    }
    .content-area,
    .widget-area {
        padding: 16px;
        border-radius: 8px;
    }
    /* 手机端首页不显示底部侧边栏 */
    body.home .widget-area {
        display: none;
    }
    .post-item .post-title {
        font-size: 18px;
    }
    .theme-switch-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .menu-toggle {
        padding: 8px;
    }
    .search-form,
    .wp-block-search__inside-form {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    .post-item {
        gap: 14px;
    }
    .post-item .post-excerpt {
        line-height: 1.65;
    }
    .wp-block-search__button {
        width: 100%;
    }
    .pagination .page-numbers {
        min-width: 34px;
        height: 34px;
    }
}

/* ====== Logo ====== */
.site-logo {
    display: inline-flex;
    align-items: center;
    max-height: 44px;
    line-height: 0;
}
.site-logo img {
    max-height: 44px;
    width: auto;
    height: auto;
}
[data-theme="dark"] .site-logo img {
    filter: brightness(0.9);
}

/* ====== 文章页顶部广告 ====== */
.post-top-ad {
    text-align: center;
    margin: 0 0 22px;
    overflow: hidden;
    line-height: 1.2;
}
.post-top-ad img {
    max-width: 100%;
    height: auto;
}
.post-top-ad.ad-mobile {
    display: none;
}
@media (max-width: 768px) {
    .post-top-ad.ad-sep {
        display: none;
    }
    .post-top-ad.ad-mobile {
        display: block;
    }
}

/* ====== PC 端导航吸附置顶 ====== */
@media (min-width: 769px) {
    .site-header {
        position: sticky;
        top: 0;
        z-index: 60;
    }
}

/* 吸附置顶时底部阴影，与内容区视觉分离 */
.site-header.is-stuck {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
}

/* ====== 文章内元素：明暗自适配（覆盖采集文章的内联样式） ====== */
/* 引用块 */
.entry-content blockquote,
.entry-content .wp-block-quote {
    margin: 22px 0;
    padding: 14px 18px;
    border-left: 4px solid var(--accent-color);
    background: var(--category-bg) !important; /* 覆盖采集内容内联 background */
    color: var(--text-color) !important;
    border-radius: 0 8px 8px 0;
    overflow: hidden;
}

.entry-content blockquote p,
.entry-content .wp-block-quote p {
    margin: 0 0 8px;
}

.entry-content blockquote p:last-child,
.entry-content .wp-block-quote p:last-child {
    margin-bottom: 0;
}

.entry-content blockquote cite,
.entry-content blockquote footer,
.entry-content .wp-block-quote cite {
    display: block;
    margin-top: 8px;
    color: var(--secondary-color);
    font-size: 13px;
    font-style: normal;
}

[data-theme="dark"] .entry-content blockquote,
[data-theme="dark"] .entry-content .wp-block-quote {
    background: #262626 !important;
    color: #e0e0e0 !important;
    border-left-color: var(--accent-color);
}

/* 代码块 / 行内代码 */
.entry-content pre {
    padding: 14px 16px;
    margin: 22px 0;
    background: #f6f8fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow-x: auto;
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.6;
}

.entry-content code {
    background: rgba(128, 128, 128, 0.12);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
    color: inherit;
}

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

[data-theme="dark"] .entry-content pre {
    background: #0d0d0d !important;
    border-color: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .entry-content code {
    background: rgba(255, 255, 255, 0.10);
    color: #e6c07b;
}

[data-theme="dark"] .entry-content pre code {
    color: #e0e0e0;
    background: none;
}

/* 表格 */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
    color: var(--text-color);
}

.entry-content th,
.entry-content td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}

.entry-content th {
    background: var(--category-bg);
    font-weight: 600;
}

[data-theme="dark"] .entry-content th,
[data-theme="dark"] .entry-content td {
    border-color: #383838 !important;
    background: transparent !important;
    color: #d5d5d5 !important;
}

[data-theme="dark"] .entry-content th {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

/* 分隔线 */
.entry-content hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 26px 0;
}

[data-theme="dark"] .entry-content hr {
    border-top-color: #383838 !important;
}

/* 视频 / iframe / 图片：响应式并适配暗夜 */
.entry-content iframe,
.entry-content video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

[data-theme="dark"] .entry-content iframe {
    filter: brightness(0.88);
}

[data-theme="dark"] .entry-content ins {
    color: #8fd08f;
    text-decoration: none;
}

[data-theme="dark"] .entry-content mark {
    background: rgba(255, 200, 60, 0.28);
    color: #ffe08a;
}

[data-theme="dark"] .entry-content kbd {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
    box-shadow: none;
}
