* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e8e8e8;
    --shadow: 0 2px 12px rgba(102, 126, 234, 0.08);
    --shadow-hover: 0 8px 24px rgba(102, 126, 234, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

/* 图片懒加载样式 */
.lazy-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200% 100% !important;
    animation: lazy-shimmer 1.5s ease-in-out infinite !important;
}

@keyframes lazy-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.lazy-loaded {
    opacity: 0;
    animation: lazy-fadein 0.4s ease-out forwards;
}

@keyframes lazy-fadein {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.lazy-error {
    background: #f5f5f5 !important;
    opacity: 0.7 !important;
}

img[data-src] {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 占位符图片 */
.placeholder-img {
    background: linear-gradient(135deg, #667eea11 0%, #764ba211 100%);
    min-height: 200px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

a:hover {
    color: var(--primary-dark);
}

.site-header {
    background: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
}

.site-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: -0.5px;
}

.site-logo:hover {
    color: var(--primary-color);
}

.main-nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    font-size: 15px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.admin-link {
    color: var(--text-lighter);
    font-size: 13px;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 20px;
}

.admin-link:hover {
    background: var(--primary-color);
    color: #fff;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 60px 0;
    margin-bottom: 40px;
}

.page-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 50px 0;
    margin-bottom: 40px;
}

.hero-content {
    text-align: center;
    color: #fff;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero-description {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 搜索页面表单美化 */
.search-form {
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-form form {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-form form:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.search-form form:focus-within {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.search-form input[type="text"] {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
    transition: all 0.3s ease;
    min-width: 0;
}

.search-form input[type="text"]::placeholder {
    color: var(--text-light);
}

.search-form input[type="text"]:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-form button {
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #fff, #f0f0f0);
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-form button:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
}

.search-form button:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .search-form {
        margin-top: 20px;
        padding: 0 16px;
    }
    
    .search-form form {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
        border-radius: 16px;
    }
    
    .search-form input[type="text"] {
        padding: 12px 16px;
        width: 100%;
    }
    
    .search-form button {
        padding: 12px 24px;
        width: 100%;
    }
}


.main-content {
    padding: 0 0 60px;
    min-height: calc(100vh - 300px);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

.primary-content {
    min-width: 0;
}

.section-title {
    font-size: 22px;
    color: var(--secondary-color);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.title-icon {
    font-size: 18px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0 12px 48px 12px;
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.post-card.featured-first {
    grid-column: span 3;
    display: grid;
    grid-template-columns: 320px 1fr;
    align-items: center;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.post-card.featured-first:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.post-card.featured-first .post-content {
    padding: 32px;
}

.post-card.featured-first .post-image {
    width: 320px;
    aspect-ratio: 16/9;
    flex-shrink: 0;
}

.post-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 24px;
}

.post-card .post-title {
    font-size: 18px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-card.featured-first .post-title {
    font-size: 22px;
}

.post-title a {
    color: var(--secondary-color);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-lighter);
}

.post-category a {
    color: var(--primary-color);
    font-weight: 500;
}

.post-category a:hover {
    text-decoration: underline;
}

.post-views::before {
    content: '👁 ';
}

.post-date::before {
    content: '📅 ';
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    gap: 24px;
}

.post-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.post-thumbnail {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-media-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cover-media-wrapper img,
.cover-media-wrapper iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.cover-media-wrapper.is-ad {
    position: relative;
}

.cover-ad-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 87, 34, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 10;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-info {
    flex: 1;
    min-width: 0;
}

.post-item .post-title {
    font-size: 17px;
    margin-bottom: 10px;
}

.post-item .post-excerpt {
    margin-bottom: 12px;
    -webkit-line-clamp: 2;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.empty-hint {
    color: var(--text-lighter);
    font-size: 14px;
}

.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-widget {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.search-widget .widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.2);
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-lighter);
}

.search-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--secondary-color);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.1);
    background: #1a252f;
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    align-items: center;
    color: var(--text-color);
    font-size: 14px;
}

.category-list a:hover {
    color: var(--primary-color);
}

.category-list a:hover .category-icon {
    color: var(--primary-color);
    transform: translateX(4px);
}

.category-icon {
    color: var(--text-lighter);
    margin-right: 10px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.category-name {
    flex: 1;
}

.category-count {
    background: var(--bg-light);
    color: var(--text-lighter);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.empty-category,
.empty-tags {
    color: var(--text-lighter);
    font-size: 14px;
    text-align: center;
    padding: 16px 0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-link {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.tag-link:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.contact-widget .contact-info {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
}

.contact-info p {
    margin-bottom: 8px;
}

.site-footer {
    background: var(--secondary-color);
    color: rgba(255,255,255,0.8);
    padding: 40px 0;
    margin-top: 20px;
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
}

.footer-links a:hover {
    color: #fff;
}

.footer-divider {
    color: rgba(255,255,255,0.3);
}

.footer-copyright {
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-copyright a {
    color: inherit;
    text-decoration: none;
}

.footer-copyright a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-made {
    font-size: 12px;
    opacity: 0.6;
}

.article-content {
    max-width: 100%;
}

.article-post {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-title {
    font-size: 32px;
    color: var(--secondary-color);
    margin-bottom: 16px;
    line-height: 1.4;
    font-weight: 700;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--text-lighter);
    margin-bottom: 12px;
}

.article-category a {
    color: var(--primary-color);
    font-weight: 500;
}

.article-category a:hover {
    text-decoration: underline;
}

.article-updated {
    color: #e67e22;
    font-size: 13px;
}

.article-updated:hover {
    opacity: 0.8;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.article-body h2 {
    font-size: 24px;
    margin: 32px 0 16px;
    color: var(--secondary-color);
    font-weight: 600;
}

.article-body h3 {
    font-size: 20px;
    margin: 28px 0 14px;
    color: var(--secondary-color);
    font-weight: 600;
}

.article-body h4 {
    font-size: 18px;
    margin: 24px 0 12px;
    color: var(--secondary-color);
    font-weight: 600;
}

.article-body p {
    margin-bottom: 16px;
}

.article-body ul, .article-body ol {
    margin: 16px 0;
    padding-left: 28px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 16px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.article-body code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: #e83e8c;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    display: block;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    margin: 20px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-body blockquote p {
    margin-bottom: 0;
    color: var(--text-light);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.article-body table th,
.article-body table td {
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    text-align: left;
}

.article-body table th {
    background: var(--bg-light);
    font-weight: 600;
}

.article-body table tr:hover {
    background: var(--bg-light);
}

.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-body a:hover {
    color: #1d6fa5;
}

.article-body hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 24px 0;
}

.article-body .ql-video {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 24px 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-caption {
    text-align: center;
    font-size: 14px;
    color: var(--text-lighter);
    margin-top: 8px;
}

.article-share {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 600;
    color: var(--secondary-color);
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-weibo {
    background: #e6162d;
    color: #fff;
}

.share-qq {
    background: #12b7f5;
    color: #fff;
}

.share-wechat {
    background: #07c160;
    color: #fff;
}

.share-copy {
    background: #6c757d;
    color: #fff;
}

.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    gap: 20px;
}

.prev-article, .next-article {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 45%;
}

.prev-article {
    align-items: flex-start;
}

.next-article {
    align-items: flex-end;
    text-align: right;
}

.nav-label {
    font-size: 13px;
    color: var(--text-lighter);
    margin-bottom: 6px;
}

.nav-title {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
}

.nav-title:hover {
    color: var(--primary-color);
}

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .sidebar-widget {
        margin-bottom: 0;
    }

    .hero-title {
        font-size: 32px;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .post-card.featured-first {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }

    .post-card.featured-first .post-image {
        width: 100%;
        aspect-ratio: 16/9;
    }

    .post-card.featured-first .post-content {
        padding: 24px;
    }

    .post-card .post-image .cover-media-wrapper {
        width: 100%;
        height: 100%;
    }

    .post-card .post-image .cover-media-wrapper img,
    .post-card .post-image .cover-media-wrapper iframe {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
}

@media (max-width: 768px) {
    .post-image {
        aspect-ratio: 16/9;
    }

    .header-inner {
        flex-direction: column;
        gap: 16px;
    }

    .main-nav {
        gap: 20px;
    }

    .hero-section {
        padding: 40px 0;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-description {
        font-size: 16px;
    }

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

    .post-thumbnail {
        width: 100%;
        height: 180px;
    }

    .post-thumbnail .cover-media-wrapper {
        width: 100%;
        height: 100%;
    }

    .post-thumbnail .cover-media-wrapper img,
    .post-thumbnail .cover-media-wrapper iframe {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 18px;
    }
}

.pagination-nav {
    padding: 30px 0;
    margin-top: 20px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    flex-wrap: wrap;
    margin-top: 40px;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.page-link:hover:not(.disabled):not(.active) {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: #fff;
    cursor: default;
}

.page-item.disabled .page-link {
    color: var(--text-lighter);
    cursor: not-allowed;
    opacity: 0.6;
}

.page-item.disabled .page-link:hover {
    transform: none;
    background: var(--bg-white);
    color: var(--text-lighter);
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e4e4e7;
        --text-light: #a1a1aa;
        --text-lighter: #71717a;
        --bg-light: #09090b;
        --bg-white: #18181b;
        --border-color: #27272a;
    }
}

[data-theme="dark"] {
    --text-color: #e8e8ec;
    --text-light: #a8a8b3;
    --text-lighter: #6b6b78;
    --bg-light: #121214;
    --bg-white: #1c1c21;
    --border-color: #2e2e36;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
}

[data-theme="dark"] body {
    background-color: var(--bg-light);
    color: var(--text-color);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .post-card,
[data-theme="dark"] .sidebar-widget,
[data-theme="dark"] .article-content,
[data-theme="dark"] .comment-item {
    background-color: var(--bg-white);
}

[data-theme="dark"] .site-header {
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .nav-link,
[data-theme="dark"] .footer-text,
[data-theme="dark"] .article-title,
[data-theme="dark"] .post-title,
[data-theme="dark"] .post-image {
    background: linear-gradient(135deg, #1c1c21 0%, #121214 100%);
}

[data-theme="dark"] .widget-title {
    color: var(--primary-color);
}

[data-theme="dark"] .search-widget {
    background: linear-gradient(135deg, #1c1c21 0%, #121214 100%);
}

[data-theme="dark"] .search-widget .widget-title {
    color: var(--text-color);
}

[data-theme="dark"] .tag-cloud a {
    background: var(--bg-light);
    color: var(--text-light);
}

[data-theme="dark"] .tag-cloud a:hover {
    background: var(--primary-color);
    color: #fff;
}

[data-theme="dark"] .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

[data-theme="dark"] .page-link {
    background: var(--bg-white);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .page-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

[data-theme="dark"] .popular-post-item {
    background: var(--bg-white);
}

[data-theme="dark"] .text-light,
[data-theme="dark"] .article-meta,
[data-theme="dark"] .post-meta {
    color: var(--text-light);
}

[data-theme="dark"] .border-top,
[data-theme="dark"] .article-content,
[data-theme="dark"] .article-share,
[data-theme="dark"] .article-nav,
[data-theme="dark"] .sidebar-widget {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
    outline: none;
}

[data-theme="dark"] .post-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: #3f3f46;
}

[data-theme="dark"] .page-link {
    background-color: var(--bg-white);
    color: var(--text-color);
}

[data-theme="dark"] code {
    background-color: #1e1e24;
    color: #dcdcaa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

[data-theme="dark"] pre {
    background-color: #1e1e24;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] pre code {
    background: transparent;
    padding: 0;
}

[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-light);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 5px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

[data-theme="dark"] blockquote {
    background-color: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-light);
}

[data-theme="dark"] .admin-link {
    background-color: var(--bg-light);
    color: var(--text-lighter);
}

[data-theme="dark"] .admin-link:hover {
    background-color: var(--primary-color);
    color: #fff;
}

[data-theme="dark"] .search-form form {
    background: rgba(24, 24, 27, 0.8);
}

[data-theme="dark"] .search-form input[type="text"] {
    background: var(--bg-white);
    color: var(--text-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: var(--text-light);
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

[data-theme="dark"] a:not(.nav-link):not(.btn):not(.page-link):not(.article-title) {
    color: #a5b4fc;
    text-decoration: none;
    transition: color 0.2s ease;
}

[data-theme="dark"] a:not(.nav-link):not(.btn):not(.page-link):not(.article-title):hover {
    color: #c7d2fe;
    text-decoration: underline;
}

[data-theme="dark"] .search-form form {
    background: rgba(30, 30, 36, 0.9);
}

[data-theme="dark"] .search-form form:hover {
    background: rgba(40, 40, 48, 0.95);
}

[data-theme="dark"] .search-form form:focus-within {
    background: rgba(45, 45, 55, 0.98);
}

[data-theme="dark"] .search-form input[type="text"] {
    background: rgba(30, 30, 36, 0.95);
    color: var(--text-color);
}

[data-theme="dark"] .search-form input[type="text"]::placeholder {
    color: var(--text-lighter);
}

[data-theme="dark"] .search-form input[type="text"]:focus {
    background: rgba(50, 50, 60, 0.98);
}

[data-theme="dark"] .search-form button {
    background: linear-gradient(135deg, var(--bg-white), var(--bg-light));
    color: var(--primary-color);
}

[data-theme="dark"] .search-form button:hover {
    background: #fff;
    color: var(--primary-dark);
}

[data-theme="dark"] .site-footer {
    background: #0f0f12;
    color: var(--text-light);
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #1c1c21 0%, #121214 100%);
}

[data-theme="dark"] .page-hero {
    background: linear-gradient(135deg, #1c1c21 0%, #121214 100%);
}

[data-theme="dark"] .hero-title {
    color: var(--text-color);
}

[data-theme="dark"] .hero-subtitle {
    color: var(--text-light);
}

[data-theme="dark"] .hero-description {
    color: var(--text-light);
    opacity: 1;
}

[data-theme="dark"] .hero-content {
    color: var(--text-light);
}

[data-theme="dark"] .footer-links a {
    color: var(--text-light);
}

[data-theme="dark"] .footer-links a:hover {
    color: var(--primary-color);
}

[data-theme="dark"] .footer-divider {
    color: var(--border-color);
}

[data-theme="dark"] .footer-copyright {
    color: var(--text-lighter);
}

.error-page {
    padding: 80px 0;
    text-align: center;
}

.error-content {
    max-width: 500px;
    margin: 0 auto;
}

.error-code {
    font-size: 120px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    line-height: 1;
}

.error-message {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.btn-home {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    color: #fff;
}

[data-theme="dark"] .error-code {
    background: linear-gradient(135deg, var(--primary-color), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .btn-home:hover {
    box-shadow: 0 8px 24px rgba(129, 140, 248, 0.4);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    z-index: 1000;
    font-size: 20px;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

[data-theme="dark"] .back-to-top {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

[data-theme="dark"] .article-body pre {
    background: #1e1e24;
    color: #dcdcaa;
}

[data-theme="dark"] .article-body code {
    background: #1e1e24;
    color: #dcdcaa;
}

[data-theme="dark"] .article-body pre code {
    background: none;
    color: inherit;
}

[data-theme="dark"] .search-form button:hover {
    background: var(--bg-white);
    color: var(--primary-dark);
}

[data-theme="dark"] .share-btn {
    background: var(--bg-light);
    color: var(--text-color);
}

[data-theme="dark"] .share-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

[data-theme="dark"] table {
    background-color: var(--bg-white);
    color: var(--text-color);
}

[data-theme="dark"] table th {
    background-color: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] table td {
    border-color: var(--border-color);
}

[data-theme="dark"] table tr:hover {
    background-color: var(--bg-light);
}
