:root {
    --bg-body: #f0f2f5;
    --bg-card: #fff;
    --bg-header: #fff;
    --bg-input: #f5f5f5;
    --bg-badge: #f0f2f5;
    --bg-badge-item: #f6f7f9;
    --text-main: #333;
    --text-secondary: #555;
    --text-muted: #999;
    --text-placeholder: #666;
    --border-color: #ddd;
    --border-divider: #eee;
    --primary-color: #007bff;
    --hover-bg: #e2effd;
    --active-bg: #d0e7ff;
    --shadow-light: rgba(0,0,0,0.05);
    --shadow-hover: rgba(0,0,0,0.08);
}

body.dark-mode {
    --bg-body: #18191a;
    --bg-card: #242526;
    --bg-header: #242526;
    --bg-input: #3a3b3c;
    --bg-badge: #3a3b3c;
    --bg-badge-item: #3a3b3c;
    --text-main: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #b0b3b8;
    --text-placeholder: #b0b3b8;
    --border-color: #3e4042;
    --border-divider: #3e4042;
    --primary-color: #4599ff;
    --hover-bg: #303030;
    --active-bg: #3a3b3c;
    --shadow-light: rgba(0,0,0,0.2);
    --shadow-hover: rgba(0,0,0,0.3);
    background-image: none !important;
}

html { overflow-y: scroll; }
body { font-family: "Microsoft YaHei", sans-serif; background-color: var(--bg-body); color: var(--text-main); margin: 0; padding: 0; line-height: 1.6; transition: background-color 0.3s, color 0.3s; }
a { text-decoration: none; color: var(--text-main); transition: color 0.2s; }
a:hover { color: var(--primary-color); }
ul, ol { list-style: none; padding: 0; margin: 0; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; box-sizing: border-box; }
.clearfix::after { content: ""; display: table; clear: both; }

.site-header { background: var(--bg-header); box-shadow: 0 1px 3px var(--shadow-light); padding: 15px 0; margin-bottom: 20px; position: sticky; top: 0; z-index: 1000; transition: background-color 0.3s; }
.site-header .container { display: flex; align-items: center; }
.logo { font-size: 24px; font-weight: bold; display: flex; align-items: center; width: 140px; margin-right: 20px; flex-shrink: 0; padding-left: 25px; box-sizing: border-box; }
.logo a { color: var(--primary-color); display: flex; align-items: center; gap: 10px; }
.logo img { height: 40px; }
.main-nav ul { display: flex; gap: 20px; }
.main-nav li a { font-size: 16px; font-weight: 500; color: var(--text-secondary); }
.main-nav li a:hover, .main-nav li.on a, .main-nav li.active a { color: var(--primary-color); }
.search-box { margin-left: auto; display: flex; align-items: center; }
.search-box form { display: flex; border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; background: var(--bg-input); }
.search-box input { border: none; padding: 8px 15px; outline: none; background: transparent; width: 200px; color: var(--text-main); }
.search-box button { background: transparent; color: var(--text-placeholder); border: none; padding: 8px 15px; cursor: pointer; }

.dark-mode-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    padding: 5px;
    margin-left: 15px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}
.dark-mode-toggle:hover {
    color: var(--primary-color);
}

.main-wrapper { display: flex; gap: 20px; align-items: flex-start; padding-top: 20px; }
.left-sidebar { width: 140px; flex-shrink: 0; position: sticky; top: 90px; }
.center-content { flex: 1; min-width: 0; }
.right-sidebar { width: 280px; flex-shrink: 0; }

.left-nav-card { background: var(--bg-card); border-radius: 8px; padding: 10px; box-shadow: 0 1px 2px var(--shadow-light); }
.left-nav-list { padding: 5px 0; }
.left-nav-list li { margin-bottom: 2px; }
.left-nav-list li a { 
    display: flex; 
    align-items: center; 
    padding: 8px 10px; 
    border-radius: 6px; 
    color: var(--text-secondary); 
    font-size: 14px; 
    font-weight: 500;
    transition: all 0.2s ease;
}
.left-nav-list li a:hover { 
    background-color: var(--hover-bg); 
    color: var(--primary-color); 
}
.left-nav-list li.active a { 
    background-color: var(--active-bg); 
    color: var(--primary-color); 
    font-weight: bold;
}
.left-nav-list li a i { 
    width: 20px; 
    text-align: center; 
    margin-right: 8px; 
    font-size: 15px;
}
.left-nav-list li a .nav-icon {
    width: 20px; 
    text-align: center; 
    margin-right: 8px;
    display: inline-block;
}
.left-nav-list li a .nav-icon i {
    margin-right: 0;
}

.nav-divider {
    height: 1px;
    background-color: var(--border-divider);
    margin: 8px 10px;
}

.post-list { display: flex; flex-direction: column; gap: 8px; }
.post-list-item { background: var(--bg-card); border-radius: 6px; padding: 12px; display: flex; gap: 12px; box-shadow: 0 1px 2px var(--shadow-light); transition: all 0.2s; align-items: center; }
.post-list-item:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--shadow-hover); }

.post-avatar { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: var(--bg-input); }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-info { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.post-title { font-size: 15px; margin: 0 0 4px; font-weight: normal; line-height: 1.4; display: flex; align-items: center; }
.post-title a { color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.post-title a:hover { color: var(--primary-color); }

.cate-prefix { color: var(--text-secondary); margin-right: 5px; font-size: 14px; }

.post-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.post-meta-item { display: flex; align-items: center; gap: 4px; background: var(--bg-badge-item); padding: 2px 8px; border-radius: 10px; }
.tag-badge { background: var(--bg-badge); color: var(--text-placeholder); padding: 2px 8px; border-radius: 4px; font-size: 12px; }

.post-action { margin-left: auto; flex-shrink: 0; }
.btn-visit { 
    display: inline-block; 
    padding: 3px 12px; 
    border: 1px solid var(--primary-color); 
    color: var(--primary-color); 
    border-radius: 100px; 
    font-size: 12px; 
    transition: all 0.2s; 
    background: rgba(0, 123, 255, 0.05);
    line-height: 1.2;
}
.btn-visit:hover { 
    background: var(--primary-color); 
    color: #fff; 
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

.widget { background: var(--bg-card); padding: 20px; margin-bottom: 20px; border-radius: 8px; box-shadow: 0 1px 2px var(--shadow-light); }
.widget-title { font-size: 16px; font-weight: bold; border-left: 4px solid var(--primary-color); padding-left: 10px; margin-bottom: 15px; color: var(--text-main); }
.widget ul li { padding: 8px 0; border-bottom: 1px dashed var(--border-divider); font-size: 14px; color: var(--text-placeholder); }
.widget ul li:last-child { border-bottom: none; }
.widget-wechat .wechat-qr { text-align: center; }
.widget-wechat .wechat-qr img { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; border-radius: 8px; background: var(--bg-input); padding: 8px; box-sizing: border-box; }
.widget-wechat .wechat-qr-copy img { cursor: pointer; }
.widget-wechat .wechat-qr-tips { margin-top: 10px; font-size: 14px; color: var(--text-secondary); font-weight: 500; text-align: center; line-height: 1.6; }
.widget-tags .tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.widget-tags .tag-item { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 3px; border: 1px solid var(--border-color); color: var(--text-secondary); font-size: 13px; line-height: 1.2; background: transparent; transition: all 0.2s; }
.widget-tags .tag-item:hover { background: var(--hover-bg); border-color: currentColor; color: var(--primary-color); }
.widget-tags .tag-count { font-size: 12px; opacity: 0.9; }
.widget-tags .tag-item:nth-child(6n+1) { color: #2f7cf6; border-color: currentColor; }
.widget-tags .tag-item:nth-child(6n+2) { color: #ff4d4f; border-color: currentColor; }
.widget-tags .tag-item:nth-child(6n+3) { color: #52c41a; border-color: currentColor; }
.widget-tags .tag-item:nth-child(6n+4) { color: #fa8c16; border-color: currentColor; }
.widget-tags .tag-item:nth-child(6n+5) { color: #722ed1; border-color: currentColor; }
.widget-tags .tag-item:nth-child(6n) { color: #13c2c2; border-color: currentColor; }
.widget-hot .hot-list li { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--border-divider); }
.widget-hot .hot-list li:last-child { border-bottom: none; }
.widget-hot .hot-index { width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; background: #f0f0f0; color: #999; font-size: 12px; flex-shrink: 0; margin-top: 2px; }
.widget-hot .hot-list li:nth-child(1) .hot-index { background: #ff4d4f; color: #fff; }
.widget-hot .hot-list li:nth-child(2) .hot-index { background: #ff7a45; color: #fff; }
.widget-hot .hot-list li:nth-child(3) .hot-index { background: #ffc53d; color: #fff; }
.widget-hot .hot-list li:nth-child(4) .hot-index { background: #73d13d; color: #fff; }
.widget-hot .hot-list li:nth-child(5) .hot-index { background: #40a9ff; color: #fff; }
.widget-hot .hot-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.widget-hot .hot-user { font-size: 12px; color: var(--text-muted); text-align: left; line-height: 1.4; }
.widget-hot .hot-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text-main); line-height: 1.5; }
.widget-hot .hot-title:hover { color: var(--primary-color); }

.pagination { margin-top: 30px; text-align: center; padding-bottom: 30px; }
.pagination .now-page, .pagination a { 
    display: inline-block; 
    vertical-align: middle;
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    line-height: 28px;
    padding: 0;
    text-align: center;
    background: var(--bg-card); 
    margin: 0 3px; 
    border-radius: 4px; 
    color: var(--text-secondary); 
    font-size: 13px;
    border: 1px solid var(--border-divider);
    box-shadow: none;
    transition: all 0.2s;
}
.pagination .now-page { 
    background: var(--primary-color); 
    color: #fff; 
    border-color: var(--primary-color);
}
.pagination a:hover { 
    background: var(--hover-bg); 
    color: var(--primary-color); 
    border-color: var(--primary-color);
}

.site-footer { background: var(--bg-header); color: var(--text-placeholder); padding: 40px 0; text-align: center; font-size: 14px; margin-top: 40px; border-top: 1px solid var(--border-divider); transition: background-color 0.3s; }

.filter-item {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    color: var(--text-placeholder);
    transition: all 0.2s;
}
.filter-item:hover {
    color: var(--primary-color);
    background: var(--hover-bg);
}
.filter-item.active {
    background: var(--primary-color);
    color: #fff;
}

.site-notice-box {
    background: var(--hover-bg);
    border-radius: 6px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--primary-color);
    font-size: 14px;
    box-sizing: border-box;
    flex-wrap: wrap;
}
.site-notice-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.5;
}
.site-notice-content i {
    font-size: 16px;
    flex-shrink: 0;
}
.site-notice-close {
    color: var(--primary-color);
    opacity: 0.6;
    transition: opacity 0.2s;
    font-size: 16px;
    padding: 0 5px;
    cursor: pointer;
    flex-shrink: 0;
}
.site-notice-close:hover {
    opacity: 1;
}

.global-ad-box {
    overflow: hidden;
}
.global-ad-box img,
.global-ad-box iframe,
.global-ad-box video {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

.top-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5253);
    color: #fff;
    font-size: 12px;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
    font-weight: normal;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.4;
}

.single-post, .single-page {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 2px var(--shadow-light);
    margin-bottom: 20px;
}
.single-header {
    border-bottom: 1px solid var(--border-divider);
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.single-title {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 15px;
    line-height: 1.4;
    font-weight: bold;
}
.single-meta {
    font-size: 13px;
    color: var(--text-muted);
}
.single-meta span {
    margin-right: 15px;
}
.single-meta a {
    color: var(--text-secondary);
}
.single-meta a:hover {
    color: var(--primary-color);
}
.single-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-main);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}
.single-content p {
    margin-bottom: 15px;
}
.single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}
.download-box {
    background: var(--bg-input);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    border: 1px dashed var(--border-color);
}
.download-box h3 {
    margin: 0 0 15px;
    font-size: 16px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}
.download-box p {
    margin: 5px 0;
    font-size: 14px;
    color: var(--text-secondary);
}
.btn-download {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 6px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-download:hover {
    background: #0069d9;
    color: #fff;
}
.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-divider);
    color: var(--text-secondary);
    font-size: 14px;
}
.post-tags a {
    display: inline-block;
    background: var(--bg-badge);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
    margin: 0 5px;
    font-size: 12px;
    transition: all 0.2s;
}
.post-tags a:hover {
    color: var(--primary-color);
    background: var(--hover-bg);
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-divider);
    font-size: 14px;
}
.post-nav-prev, .post-nav-next {
    width: 48%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}
.post-nav-prev span:first-child, .post-nav-next span:first-child {
    color: var(--text-muted);
    font-size: 12px;
}
.post-nav-prev a, .post-nav-next a {
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}
.post-nav-prev a:hover, .post-nav-next a:hover {
    color: var(--primary-color);
}
.post-nav-next {
    text-align: right;
    align-items: flex-end;
}
.nav-none {
    color: var(--text-placeholder);
}

.related-articles {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-divider);
}
.related-articles h3 {
    font-size: 16px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}
.related-articles ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
    margin-right: -10px;
}
.related-articles li {
    width: 50%;
    padding: 0 10px;
    margin-bottom: 4px;
    line-height: 1.5;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    font-size: 13px;
}
.related-index {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: #e9ecef;
    color: #495057;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 6px;
    flex-shrink: 0;
}
.related-articles li a {
    color: var(--text-main);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
}
.related-articles li a:hover {
    color: var(--primary-color);
}

.friend-links {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-divider);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 14px;
}
.friend-links-label {
    font-weight: bold;
    margin-right: 10px;
    color: var(--text-main);
}
.friend-links-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.friend-links-items li {
    margin: 0;
}
.friend-links-items li a {
    color: var(--text-secondary);
    text-decoration: none;
}
.friend-links-items li a:hover {
    color: var(--primary-color);
}

.mobile-menu-icon { display: none; }

@media (max-width: 992px) {
    .site-header { padding: 10px 0; position: static; }
    .site-header .container { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; }

    .logo { width: auto; flex: 0 0 auto; margin-right: 0; padding-left: 0; justify-content: flex-start; order: 1; }
    .logo a { justify-content: flex-start; }

    .search-box { margin-left: 0; width: auto; flex: 0 0 auto; order: 3; }
    .search-box form { flex: 1; }
    .search-box input { width: 100%; min-width: 0; padding: 7px 12px; font-size: 14px; }
    .search-box button { padding: 7px 12px; min-width: 56px; white-space: nowrap; font-size: 14px; }

    .user-avatar { display: none !important; }
    .mobile-menu-icon { display: block !important; font-size: 20px; color: var(--text-color); padding: 8px; }

    .dark-mode-toggle {
        position: fixed;
        bottom: 80px;
        right: 20px;
        z-index: 9999;
        background: transparent;
        color: #ff4d4f;
        border: none;
        box-shadow: none;
        border-radius: 0;
        width: auto;
        height: auto;
        justify-content: center;
        margin-left: 0;
        padding: 10px;
        font-size: 40px;
        transition: transform 0.3s;
    }
    .dark-mode-toggle:hover { 
        transform: scale(1.1);
        box-shadow: none;
        background: transparent;
        color: #ff4d4f;
    }
    .dark-mode-toggle:active { transform: scale(0.95); }
    body.dark-mode .dark-mode-toggle {
        background: transparent;
        color: #ff4d4f;
        border: none;
        box-shadow: none;
    }
    body.dark-mode .dark-mode-toggle:hover {
        color: #ff4d4f;
        background: transparent;
    }

    .main-nav { width: auto; flex: 1; order: 2; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .main-nav ul { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 0; justify-content: flex-start; }
    .main-nav li { flex: 0 0 auto; }

    .main-wrapper { flex-direction: column; padding-top: 10px; }
    .left-sidebar, .right-sidebar, .center-content { width: 100%; position: static; top: auto; }

    .left-nav-card { padding: 10px; }
    .left-nav-list { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0; scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain; scroll-behavior: smooth; }
    .left-nav-list::-webkit-scrollbar { height: 0; display: none; }
    .left-nav-list li { margin-bottom: 0; flex: 0 0 auto; }
    .left-nav-list li a { padding: 8px 12px; white-space: nowrap; justify-content: center; gap: 6px; font-size: 13px; line-height: 1.1; background: var(--bg-input); border: 1px solid var(--border-divider); border-radius: 999px; }
    .left-nav-list li a i { font-size: 14px; margin-right: 0; }
    .left-nav-list li a .nav-icon { width: auto; margin-right: 0; }
    .left-nav-list li.active a { background: var(--active-bg); border-color: var(--primary-color); }
    .nav-divider { display: none; }

    .post-list-item { align-items: flex-start; position: relative; padding-right: 76px; }
    .post-info { flex: 1 1 auto; min-width: 0; }
    .post-title a { white-space: normal; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
    .post-action { position: absolute; top: 12px; right: 12px; margin-left: 0; }

    .single-post, .single-page, .widget { padding: 18px; }
    .post-navigation { flex-direction: column; gap: 12px; }
    .post-nav-prev, .post-nav-next { width: 100%; }
    .post-nav-next { align-items: flex-start; text-align: left; }

    .related-articles li { width: 100%; }

    .category-header-box {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 99;
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0 !important;
        padding: 15px 15px !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
        border-bottom: 1px solid var(--border-divider);
    }

    .site-footer {
        padding: 20px 0;
        margin-top: 20px;
    }
    .site-footer p {
        margin: 5px 0;
        line-height: 1.5;
        word-wrap: break-word;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .logo { font-size: 20px; }
    .search-box input { padding: 8px 12px; }
    .search-box button { min-width: 52px; }
    .post-list-item { padding: 10px; padding-right: 70px; }
    .post-title { font-size: 14px; }
    .single-title { font-size: 17px; }
    .post-action { top: 10px; right: 10px; }
    .left-nav-list { gap: 6px; }
    .left-nav-list li a { padding: 7px 10px; font-size: 12px; }
    
    .category-header-box {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .site-footer {
        padding: 15px 0;
        font-size: 12px;
    }
}