/*
Theme Name: Sunndy Blog Theme
Theme URI: https://sunndy.com
Author: Sunndy
Author URI: https://sunndy.com
Description: 极简黑白灰博客主题，支持亮色/暗色双主题切换，专为写作者设计。简洁、专注、响应式。
Version: 1.0.2
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sunndy-blog-theme
Tags: blog, two-columns, right-sidebar, custom-logo, dark-mode, minimalist, black-and-white
*/

/* ========== CSS Variables (Light / Dark) ========== */
:root {
    --bg: #fff;
    --bg-card: #fff;
    --bg-dark: #000;
    --text: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --code-bg: #f0f0f0;
    --blockquote-bg: #f9f9f9;
    --accent: #000;
    --cat-bg: #e8e8e8;
}
[data-theme="dark"] {
    --bg: #111;
    --bg-card: #1a1a1a;
    --bg-dark: #000;
    --text: #ddd;
    --text-secondary: #aaa;
    --text-muted: #777;
    --border: #333;
    --border-light: #2a2a2a;
    --code-bg: #2a2a2a;
    --blockquote-bg: #1e1e1e;
    --accent: #fff;
    --cat-bg: #333;
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========== Top Bar ========== */
.top-bar {
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 12px;
    padding: 6px 0;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar .top-bar-left { display: flex; align-items: center; gap: 14px; }
.top-bar .top-bar-date { letter-spacing: 0.5px; }

/* Theme Toggle - Slider Switch */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    touch-action: manipulation;
}
.theme-toggle-track {
    display: block;
    width: 40px;
    height: 22px;
    background: #555;
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
}
.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
[data-theme="dark"] .theme-toggle-track {
    background: #888;
}
[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(18px);
}

/* ========== Header ========== */
.site-header {
    background: var(--bg);
    padding: 35px 0 20px;
}
/* 吸顶 Header（移动端） */
.site-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
}
.site-header.sticky-hidden {
    transform: translateY(-100%);
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-branding { display: flex; flex-direction: column; }
.site-logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 2px;
}
.site-logo .logo-light { color: var(--text-secondary); font-weight: 300; }
.site-tagline { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Logo Images */
.custom-logo-link { 
    position: relative; 
    display: inline-block; 
    min-height: 50px; 
}
.custom-logo { 
    max-height: 50px; 
    width: auto; 
    display: block;
}
.custom-logo-light { 
    position: relative; 
    opacity: 1; 
}
.custom-logo-dark { 
    position: absolute; 
    top: 0; 
    left: 0; 
    opacity: 0; 
}
[data-theme="dark"] .custom-logo-light { opacity: 0; }
[data-theme="dark"] .custom-logo-dark { opacity: 1; }

/* ========== Navigation ========== */
.main-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
/* 吸顶导航（桌面端） */
.main-nav.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    transform: translateY(0);
    transition: transform 0.3s ease;
}
.main-nav.sticky-hidden {
    transform: translateY(-100%);
}
.main-nav .container { display: flex; align-items: center; flex-wrap: nowrap; }
.main-nav .menu {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
}
.main-nav .menu li { flex-shrink: 0; }
.main-nav .menu li a {
    display: block;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    position: relative;
    white-space: nowrap;
}
.main-nav .menu li a::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 6px;
    height: 4px;
    background: transparent;
}
.main-nav .menu li a:hover {
    color: var(--text);
}
.main-nav .menu .current-menu-item a::after {
    background: var(--accent);
}
.nav-more {
    position: relative;
    flex-shrink: 0;
}
.nav-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    cursor: pointer;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    height: 100%;
}
.nav-more-btn:hover {
    color: var(--text-secondary);
}
.nav-more-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    min-width: 140px;
    z-index: 100;
    list-style: none;
    padding: 0;
    margin: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.nav-more:hover .nav-more-dropdown {
    display: block;
}
.nav-more-dropdown li {
    list-style: none;
}
.nav-more-dropdown li a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.nav-more-dropdown li a:hover {
    background: var(--blockquote-bg);
    color: var(--text);
}
.nav-more-dropdown .current-menu-item a {
    color: var(--accent);
}
.nav-search {
    margin-left: auto;
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    padding: 0 10px;
}
.nav-search:hover { color: var(--text-secondary); }

/* Search Overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-overlay-inner {
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
    position: relative;
}
.search-overlay .search-form {
    display: flex;
    border-bottom: 2px solid #fff;
}
.search-overlay .search-form input[type="search"] {
    flex: 1;
    border: none;
    background: none;
    padding: 14px 0;
    font-size: 18px;
    color: #fff;
    outline: none;
}
.search-overlay .search-form input[type="search"]::placeholder { color: #999; }
.search-overlay .search-form button {
    background: none;
    border: none;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    font-size: 18px;
}
.search-close {
    position: absolute;
    top: -40px;
    right: 20px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

/* ========== Hero / Featured ========== */
.hero-section { padding: 40px 0 10px; }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.hero-main {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #222;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
}
.hero-main .hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-main .hero-img-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #444 100%);
}
.hero-main .hero-content {
    position: relative;
    z-index: 1;
    padding: 40px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    width: 100%;
}
.hero-main .hero-cat {
    display: inline-block;
    background: #fff;
    color: #000;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.hero-main .hero-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}
.hero-main .hero-meta { font-size: 13px; color: #ccc; }

.hero-side { display: flex; flex-direction: column; gap: 20px; }
.hero-side-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #333;
    flex: 1;
    display: flex;
    align-items: flex-end;
}
.hero-side-item .hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-side-item .hero-img-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #2a2a2a 0%, #555 100%);
}
.hero-side-item .hero-content {
    position: relative;
    z-index: 1;
    padding: 24px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    width: 100%;
}
.hero-side-item .hero-cat {
    display: inline-block;
    background: #fff;
    color: #000;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.hero-side-item .hero-title { font-size: 16px; font-weight: 600; line-height: 1.4; }

/* ========== Content Area ========== */
.content-area { padding: 40px 0; }
.content-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; }
.content-grid.no-sidebar { grid-template-columns: 1fr; }

/* ========== Section Title ========== */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent);
    display: inline-block;
}

/* ========== Post Items ========== */
.post-item {
    display: flex;
    gap: 20px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: none; }
.post-thumb {
    width: 280px;
    height: 180px;
    border-radius: 4px;
    background: #ddd;
    flex-shrink: 0;
    overflow: hidden;
}
.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-thumb .thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 14px;
    background: linear-gradient(135deg, #e0e0e0, #ccc);
}
.post-info { flex: 1; display: flex; flex-direction: column; }
.post-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
    background: var(--cat-bg);
    padding: 3px 10px;
    align-self: flex-start;
    margin-bottom: 8px;
}
.post-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-title a { display: inline; }
.post-title a:hover { color: var(--text-secondary); }
.post-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: auto;
}
.post-meta span { display: flex; align-items: center; gap: 4px; }
.post-meta svg { flex-shrink: 0; }

/* Load More */
.load-more {
    display: block;
    text-align: center;
    padding: 12px;
    border: 2px solid var(--accent);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.2s;
    cursor: pointer;
    margin-top: 10px;
}
.load-more:hover { background: var(--accent); color: #000; }

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 30px;
}
.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--bg-dark);
    color: #fff;
    border-color: var(--bg-dark);
}
.pagination .next,
.pagination .prev { font-weight: 600; }

/* ========== Sidebar ========== */
.sidebar-widget {
    background: var(--bg-card);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}
.sidebar-widget img,
.sidebar-widget figure,
.sidebar-widget iframe,
.sidebar-widget video,
.sidebar-widget embed {
    max-width: 100%;
    height: auto;
}
.widget-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

/* Recent Posts Widget */
.recent-post {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.recent-post:last-child { border-bottom: none; }
.recent-post .rp-thumb {
    width: 70px;
    height: 70px;
    background: #ddd;
    border-radius: 3px;
    flex-shrink: 0;
    overflow: hidden;
}
.recent-post .rp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recent-post .rp-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.recent-post .rp-info .rp-date { font-size: 11px; color: var(--text-muted); }

/* WordPress Recent Posts Widget */
.widget_recent_entries ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.widget_recent_entries ul li:last-child { border-bottom: none; }
.widget_recent_entries ul li a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: block;
    margin-bottom: 4px;
}
.widget_recent_entries .post-date {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

/* Categories Widget */
.widget_categories ul li,
.widget_archive ul li,
.widget_meta ul li,
.widget_pages ul li,
.widget_nav_menu ul li { border-bottom: 1px solid var(--border-light); }
.widget_categories ul li a,
.widget_archive ul li a,
.widget_meta ul li a,
.widget_pages ul li a,
.widget_nav_menu ul li a {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 13px;
    color: var(--text);
}
.widget_categories ul li a:hover,
.widget_archive ul li a:hover,
.widget_meta ul li a:hover,
.widget_pages ul li a:hover,
.widget_nav_menu ul li a:hover { color: var(--bg-dark); font-weight: 600; }
.widget_categories .count,
.widget_archive .count { color: var(--text-muted); font-size: 12px; }

/* Tag Cloud Widget */
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}
.tagcloud a {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.tagcloud a:hover { background: var(--bg-dark); color: #fff !important; border-color: var(--bg-dark); }

/* Search Widget */
.widget_search .search-form {
    display: flex;
    border: 1px solid var(--border);
    overflow: hidden;
}
.widget_search .search-form input[type="search"] {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 13px;
    outline: none;
    background: var(--bg-card);
    color: var(--text);
}
.widget_search .search-form button {
    background: var(--bg-dark);
    color: #fff;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
}

/* ========== Single Post ========== */
.single-post-content { padding: 0; }
.single-header { margin-bottom: 24px; }
.single-header .single-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
    background: var(--cat-bg);
    padding: 3px 10px;
    margin-bottom: 12px;
}
.single-header .single-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 12px;
}
.single-header .single-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.single-featured-image { margin: 0 0 24px; }
.single-featured-image img { width: 100%; height: auto; }
.single-featured-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #ddd, #bbb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}
.entry-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.entry-content iframe,
.entry-content video,
.entry-content embed,
.entry-content object {
    max-width: 100%;
}
.entry-content table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    border-collapse: collapse;
}
.entry-content h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 28px 0 14px;
    background: var(--blockquote-bg);
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.3s ease;
}
.entry-content h1:hover {
    border-color: var(--text-secondary);
}
.entry-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 28px 0 14px;
    background: var(--blockquote-bg);
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.3s ease;
}
.entry-content h2:hover {
    border-color: var(--text-secondary);
}
.entry-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s ease;
}
.entry-content h3:hover {
    border-color: var(--text-secondary);
}
.entry-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 10px;
    border-left: 3px solid var(--text);
    padding-left: 10px;
}
.entry-content p { margin-bottom: 16px; }
.entry-content blockquote {
    border-left: 3px solid var(--bg-dark);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--blockquote-bg);
    color: var(--text-secondary);
    font-style: italic;
}
.entry-content ul, .entry-content ol {
    margin: 12px 0 16px 24px;
    list-style: disc;
}
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 6px; }
.entry-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: "SF Mono", "Fira Code", monospace;
}
.entry-content pre {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 13px;
    line-height: 1.6;
}
.entry-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 16px 0;
}

/* Post Tags */
.post-tags {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.post-tags-label { font-size: 13px; font-weight: 700; color: var(--text); }
.post-tags a {
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 4px 12px;
    transition: all 0.2s;
}
.post-tags a:hover { background: var(--bg-dark); color: #fff; border-color: var(--bg-dark); }

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.post-navigation a {
    font-size: 13px;
    color: var(--text);
    max-width: 45%;
}
.post-navigation a:hover { color: var(--text-secondary); }
.post-navigation .nav-label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 4px; }

/* ========== Comments ========== */
.comments-area {
    margin-top: 30px;
    background: var(--bg-card);
    padding: 30px;
    border: 1px solid var(--border);
}
.comments-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}
.comment-list { margin-bottom: 30px; }
.comment-list li { margin-bottom: 20px; }
.comment-body { padding: 16px; background: var(--blockquote-bg); border-radius: 4px; }
.comment-author { font-weight: 600; color: var(--text); font-size: 14px; }
.comment-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.comment-meta a { color: var(--text-muted); }
.comment-content { font-size: 14px; color: var(--text); line-height: 1.6; }
.comment-reply-link {
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 2px 10px;
    display: inline-block;
    margin-top: 8px;
}
.comment-reply-link:hover { background: var(--bg-dark); color: #fff; border-color: var(--bg-dark); }

/* Comment Form */
.comment-respond { margin-top: 20px; }
.comment-reply-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}
.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    border: 1px solid var(--border);
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg-card);
    color: var(--text);
}
.comment-form textarea:focus,
.comment-form input:focus { border-color: var(--bg-dark); }
.comment-form textarea { height: 140px; resize: vertical; }
.comment-form .submit {
    background: var(--bg-dark);
    color: #fff;
    border: none;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.comment-form .submit:hover { background: #333; }

/* 评论验证码 */
.comment-form-captcha label {
    display: block;
}
.comment-form-captcha input[type="text"] {
    width: 100% !important;
}
.comment-form-captcha .captcha-error::placeholder {
    color: #d32f2f;
    opacity: 1;
}

/* ========== Archive Page ========== */
.archive-header {
    background: var(--bg-card);
    padding: 24px 30px;
    border: 1px solid var(--border);
    margin-bottom: 30px;
}
.archive-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.archive-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.no-results h2 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 12px;
}
.no-results p { color: var(--text-secondary); font-size: 14px; }

/* ========== Page ========== */
.page-content {
    padding: 0;
}
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

/* ========== 404 ========== */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}
.error-404 h1 {
    font-size: 80px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 16px;
}
.error-404 h2 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 8px;
}
.error-404 p { color: var(--text-secondary); font-size: 14px; }
.error-404 .search-form {
    display: flex;
    max-width: 400px;
    margin: 24px auto 0;
    border: 1px solid var(--border);
}
.error-404 .search-form input[type="search"] {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 13px;
    outline: none;
    background: var(--bg-card);
    color: var(--text);
}
.error-404 .search-form button {
    background: var(--bg-dark);
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
}

/* ========== Footer ========== */
.site-footer {
    background: var(--bg-dark);
    color: var(--text-muted);
    padding: 50px 0 0;
    margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-bottom: 40px; }
.footer-col h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}
.footer-col img,
.footer-col figure,
.footer-col iframe,
.footer-col video,
.footer-col embed {
    max-width: 100%;
    height: auto;
}
.footer-col p { font-size: 13px; line-height: 1.7; }
.footer-col ul li { padding: 6px 0; }
.footer-col ul li a { font-size: 13px; color: var(--text-muted); }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid #222;
    padding: 20px 0;
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* ========== Back to Top ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 42px;
    height: 42px;
    background: var(--bg-dark);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: #333; }

/* 灯箱背景改为黑色 */
.wp-lightbox-overlay .scrim {
    background-color: #000 !important;
}
.wp-lightbox-overlay {
    background: #000 !important;
}
.wp-lightbox-caption {
    text-align: center;
}
/* 灯箱关闭按钮在黑色背景下可见 */
.wp-lightbox-overlay button {
    filter: invert(1);
}
.entry-content figcaption,
.wp-block-image figcaption {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 0;
}

/* ========== Responsive ========== */

/* 桌面端隐藏移动端元素 */
.mobile-menu-toggle,
.mobile-header-actions,
.mobile-nav-panel,
.mobile-nav-overlay { display: none; }

@media (max-width: 768px) {
    /* 隐藏顶部栏 */
    .top-bar { display: none; }

    /* 隐藏桌面导航 */
    .main-nav { display: none; }

    /* 移动端 Header */
    .site-header {
        background: var(--bg-dark);
        padding: 12px 0;
    }
    .site-header .container {
        display: grid;
        grid-template-columns: 36px 1fr auto;
        align-items: center;
        gap: 12px;
    }
    .site-branding {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-width: 0;
    }
    .site-tagline { display: none; }
    .site-logo {
        font-size: 20px;
        color: #fff;
    }
    .custom-logo-link { min-height: 30px; }
    .custom-logo { max-height: 30px; }
    /* 移动端仅显示暗色 Logo */
    .custom-logo-light {
        position: absolute !important;
        opacity: 0 !important;
    }
    .custom-logo-dark {
        position: relative !important;
        opacity: 1 !important;
    }
    [data-theme="dark"] .site-logo { color: #fff; }

    /* 汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 24px;
        height: 24px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        position: relative;
        z-index: 10;
        touch-action: manipulation;
    }
    .mobile-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: #fff;
        border-radius: 1px;
        transition: transform 0.2s, opacity 0.2s;
    }
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* 移动端右侧操作按钮 */
    .mobile-header-actions {
        display: flex !important;
        align-items: center;
        gap: 12px;
        position: relative;
        z-index: 10;
    }
    .mobile-search-toggle {
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 0;
        display: flex;
        align-items: center;
        position: relative;
        z-index: 10;
        touch-action: manipulation;
    }
    .mobile-header-actions .theme-toggle {
        position: relative;
        z-index: 10;
        touch-action: manipulation;
    }

    /* 移动端导航面板 */
    .mobile-nav-panel {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        background: var(--bg-card);
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding: 0;
    }
    .mobile-nav-panel.open {
        transform: translateX(0);
    }
    .mobile-nav-header {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid var(--border);
    }
    .mobile-nav-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--text);
    }
    .mobile-nav-close {
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text);
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }
    .mobile-menu {
        padding: 12px 0;
    }
    .mobile-menu li a {
        display: block;
        padding: 14px 20px;
        font-size: 16px;
        font-weight: 600;
        color: var(--text);
        border-bottom: 1px solid var(--border-light);
    }
    .mobile-menu .current-menu-item a {
        color: var(--accent);
    }

    .mobile-nav-overlay {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }
    .mobile-nav-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    /* 原有响应式样式 */
    .hero-grid { grid-template-columns: 1fr; }
    .hero-side { flex-direction: row; }
    .hero-side-item { min-height: 140px; }
    .hero-main { min-height: 260px; }
    .hero-main .hero-content { padding: 24px; }
    .hero-main .hero-title { font-size: 20px; }
    .content-grid { grid-template-columns: 1fr; }
    .main-content { overflow-x: hidden; }
    .post-item {
        flex-direction: row;
        gap: 14px;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    .post-thumb {
        width: 140px;
        height: 90px;
        flex-shrink: 0;
    }
    .post-cat { display: none; }
    .post-title {
        font-size: 15px;
        line-height: 1.4;
        margin-bottom: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .post-excerpt { display: none; }
    .post-meta { font-size: 11px; gap: 12px; }
    .single-post-content { padding: 0; }
    .single-featured-image { margin: 0 0 20px; }
    .single-header .single-title { font-size: 22px; }
    .footer-grid { grid-template-columns: 1fr; }
    .post-navigation { flex-direction: column; gap: 12px; }
    .post-navigation a { max-width: 100%; }

    /* 移动端分页 */
    .pagination { margin-top: 20px; }
    .pagination .nav-links { gap: 4px; }
    .pagination .page-numbers {
        min-width: 30px;
        height: 30px;
        padding: 0 6px;
        font-size: 12px;
    }
    .pagination .next,
    .pagination .prev { min-width: 30px; padding: 0; }
    .pagination .page-numbers svg {
        width: 12px;
        height: 12px;
    }
}

/* ========== WordPress Core Classes ========== */
.alignnone { margin: 5px 20px 20px 0; }
.aligncenter, div.aligncenter { display: block; margin: 5px auto; }
.alignright { float: right; margin: 5px 0 20px 20px; }
.alignleft { float: left; margin: 5px 20px 20px 0; }
.wp-caption { max-width: 100%; margin-bottom: 20px; }
.wp-caption-text { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal; }
.gallery-caption { font-size: 12px; color: var(--text-muted); }
.bypostauthor { }
.sticky { }