:root {
    --primary-color: #4a90e2;
    --primary-hover: #2c3e50;
    --secondary-color: #2c3e50;
    --secondary-light: #4a90e2;
    --background-color: #f5f7fa;
    --surface-color: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #e1e4e8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --transition: all 0.2s ease;
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Dark mode colors */
    --dark-primary: #4a90e2;
    --dark-primary-hover: #2c3e50;
    --dark-secondary: #2c3e50;
    --dark-background: #1a1a2e;
    --dark-surface: #16213e;
    --dark-text: #e1e5ee;
    --dark-text-secondary: #a4a8b4;
    --dark-border: #2a3958;
    --transition-color: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;

    /* 浅色模式 */
    --header-bg: #ffffff;
    --header-text: #333333;
    --header-button-bg: #f5f7fa;
    --header-button-text: #333333;
    --header-button-border: #e1e4e8;
    --header-button-hover-bg: #4a90e2;
    --header-button-hover-text: #ffffff;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
    scroll-behavior: smooth;
    transition: var(--transition-color);
}

.container {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
    view-transition-name: container;
    gap: 2rem;
    background: var(--background-color);
    transition: var(--transition);
}

.sidebar {
    background: var(--surface-color);
    padding: 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    display: flex;
    flex-direction: column;
    transition: var(--transition-color);
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: var(--transition-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.sidebar-logo {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    transition: transform 0.3s ease;
}

.sidebar-brand:hover .sidebar-logo {
    transform: scale(1.05);
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition-color);
}

.sidebar-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: var(--background-color);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
    width: 100%;
    font-weight: 500;
}

.sidebar-back:hover {
    background: rgba(74, 144, 226, 0.1);
    transform: translateX(-3px);
}

.back-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.sidebar-back:hover .back-icon {
    transform: translateX(-2px);
}

.search-container {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 9000;
    transition: var(--transition-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    display: flex;
    align-items: center;
    left: 1rem;
    color: var(--primary-color);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: var(--background-color);
    transition: var(--transition);
    color: var(--text-color);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.search-results {
    position: absolute;
    top: calc(100% - 1.5rem);
    left: 1.5rem;
    right: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    transition: var(--transition);
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

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

.search-result-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.search-result-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    transition: var(--transition-color);
}

.search-result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    transition: var(--transition-color);
}

.search-result-category {
    color: var(--secondary-color);
    font-weight: 500;
    transition: var(--transition-color);
}

.search-result-date {
    color: var(--text-secondary);
    transition: var(--transition-color);
}

.search-result-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.no-results {
    padding: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sidebar-nav {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 1rem;
}

/* 主页标题链接样式 */
.header-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    /*margin-bottom: 10px;*/
    position: relative;
}

.header-link:hover .header-logo {
    transform: scale(1.1);
}

.header-link:hover .site-title {
    background-size: 200% 100%;
    background-position: 100% 0;
}

.header-logo {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--header-text);
    margin: 0;
    position: relative;
    padding-bottom: 12px;
    line-height: 1.2;
}

.site-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 70%, transparent);
    opacity: 0.5;
    animation: shimmer 3s infinite linear;
    background: linear-gradient(90deg,
    transparent,
    var(--primary-color),
    transparent);
    background-size: 200% 100%;
}

.category {
    margin: 1rem 0;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-title:hover {
    background: var(--background-color);
    border-left-color: var(--primary-color);
}

.category-title::after {
    content: '▸';
    margin-left: auto;
    transition: transform 0.2s;
}

.category-title[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

.content {
    padding: 3rem 4rem;
    min-width: 300px;
    max-width: 800px;
    margin: 2rem auto;
    background: var(--surface-color);
    border-radius: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* 通用 Markdown 样式 */
#article-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
    font-size: 1rem;
    color: var(--text-color);
}

#article-content h1,
#article-content h2,
#article-content h3,
#article-content h4,
#article-content h5,
#article-content h6 {
    margin: 1.5em 0 0.5em;
    line-height: 1.4;
    color: var(--heading-color);
}

#article-content h1 {
    font-size: 2em;
}

#article-content h2 {
    font-size: 1.5em;
}

#article-content h3 {
    font-size: 1.25em;
}

#article-content h4 {
    font-size: 1em;
}

#article-content h5 {
    font-size: 0.875em;
}

#article-content h6 {
    font-size: 0.85em;
}

#article-content p {
    margin: 1em 0;
}

#article-content a {
    color: var(--primary-color);
    text-decoration: none;
}

#article-content a:hover {
    text-decoration: underline;
}

#article-content ul,
#article-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

#article-content li {
    margin: 0.5em 0;
}

#article-content blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 4px solid var(--primary-color);
    background: var(--background-color);
}

#article-content code {
    padding: 0.2em 0.4em;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    background: var(--background-color);
    border-radius: 3px;
}

#article-content pre {
    margin: 1em 0;
    padding: 1em;
    overflow-x: auto;
    background: var(--background-color);
    border-radius: 6px;
}

#article-content pre code {
    padding: 0;
    background: none;
}

#article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

#article-content table {
    width: 100%;
    margin: 1em 0;
    border-collapse: collapse;
}

#article-content th,
#article-content td {
    padding: 0.5em;
    border: 1px solid var(--border-color);
}

#article-content th {
    background: var(--background-color);
}

/* 暗黑模式适配 */
[data-theme="dark"] #article-content {
    --text-color: #e8eaed;
    --heading-color: var(--dark-primary);
    --border-color: rgba(255, 255, 255, 0.1);

    background: var(--dark-surface);
    color: var(--text-color);
}

[data-theme="dark"] #article-content code {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #article-content pre {
    background: #2d3748;
}

[data-theme="dark"] #article-content blockquote {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--dark-primary);
}

.hidden {
    display: none;
}

/* 恢复响应式布局样式 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        border-radius: 0;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .header-link {
        margin-bottom: 0.5rem;
    }

    .header-search {
        width: 100%;
        max-width: none;
    }

    .header-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

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

/* 搜索结果样式 */
.header-search .search-icon {
    position: static;
    padding: 0 0.5rem 0 0.75rem;
    color: var(--primary-color);
    opacity: 0.7;
}

#header-search-input {
    border: none;
    background: transparent;
    padding: 0.5rem;
    flex-grow: 1;
    font-size: 0.95rem;
    color: var(--text-color);
    outline: none;
}

#header-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.header-search .search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 1000;
    display: none;
    overflow: hidden;
    max-height: 400px;
}

/* 新增暗黑模式样式 */
[data-theme="dark"] {
    --background-color: var(--dark-background);
    --surface-color: var(--dark-surface);
    --text-color: var(--dark-text);
    --text-secondary: var(--dark-text-secondary);
    --border-color: var(--dark-border);
    --primary-color: var(--dark-primary);
    --card-background: var(--dark-surface);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .home-header {
    background-color: var(--dark-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

[data-theme="dark"] .header-button {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--dark-text);
    border-color: transparent;
}

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

[data-theme="dark"] #language-selector {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--dark-text);
}

[data-theme="dark"] #language-selector:hover {
    background-color: var(--dark-primary);
    color: white;
}

/* 新增主题切换按钮 */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 80px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    animation: pulseGlow 1.5s infinite;
    transform: translateY(-5px);
}

.light-icon, .dark-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.light-icon {
    opacity: 0;
    transform: scale(0.5);
}

.dark-icon {
    opacity: 1;
    transform: scale(1);
}

[data-theme="dark"] .light-icon {
    opacity: 1;
    transform: scale(1);
}

[data-theme="dark"] .dark-icon {
    opacity: 0;
    transform: scale(0.5);
}

/* 新增渐变过渡效果 */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

/* 新增主页头部样式 */
.home-header {
    background-color: var(--card-background, var(--surface-color));
    box-shadow: 0 2px 10px var(--shadow-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 40px;
    transition: var(--transition-color);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.header-logo:hover {
    transform: scale(1.05) rotate(-8deg);
}

.home-header .site-title {
    color: var(--header-text);
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
}

/* 新增分类网格布局 */
.home-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    transition: var(--transition-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* 分类卡片样式 */
.category-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
    animation: scaleIn 0.5s ease-out forwards;
    opacity: 0;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
    position: relative;
    overflow: hidden;
}

.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0;
    transform: translate(50%, -50%);
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.category-card:hover::after {
    opacity: 0.1;
}

.category-card:hover {
    transform: translateY(-7px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 12px 24px var(--shadow-color);
}

.category-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.category-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background-color: rgba(74, 144, 226, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
    animation: floatUp 2s infinite ease-in-out;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.category-title:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.category-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.category-card:hover .category-card-header::after {
    width: 100%;
}

/* 最新文章列表 */
.recent-articles {
    padding: 1.5rem;
    background-color: rgba(74, 144, 226, 0.03);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

[data-theme="dark"] .recent-articles {
    background-color: rgba(255, 255, 255, 0.02);
}

/* 移动设备优化 */
@media (max-width: 768px) {
    .category-card {
        transform: none;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .nav-article-item,
    .recent-article-item {
        padding: 0.75rem 0.75rem 0.75rem 1rem;
    }

    .article-date-small {
        font-size: 0.75em;
        padding: 0.15rem 0.4rem;
    }

    .recent-article-item {
        margin-bottom: 0.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.nav-category {
    margin-bottom: 1.5rem;
}

.nav-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    margin: 0;
    cursor: pointer;
    transition: var(--transition-color);
}

.nav-category-title:hover {
    background: rgba(74, 144, 226, 0.1);
    border-radius: 0.5rem;
}

.nav-article-list {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.nav-article-item {
    display: block;
    padding: 0.7rem 1rem;
    margin-bottom: 0.25rem;
    position: relative;
    border-radius: var(--radius-md);
    transition: var(--transition-color);
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color);
    text-decoration: none;
    border-left: 3px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: var(--surface-color);
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
    animation-delay: calc(var(--animation-order, 0) * 0.05s);
}

.nav-article-item::before {
    content: none;
}

.nav-article-item:hover {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
    border-left-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(74, 144, 226, 0.2);
}

[data-theme="dark"] .nav-article-item {
    color: #e2e8f0;
}

[data-theme="dark"] .nav-article-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-primary);
}

/* 最近文章项样式 */
.recent-article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    transition: var(--transition-color);
    position: relative;
    border-left: 3px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: var(--surface-color);
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
    animation-delay: calc(var(--animation-order, 0) * 0.05s);
}

.recent-article-item::before {
    content: none;
}

.recent-article-item:hover {
    background: rgba(74, 144, 226, 0.1);
    transform: translateX(3px);
    border-left-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(74, 144, 226, 0.2);
}

/* 暗黑模式适配 */
[data-theme="dark"] .nav-article-item,
[data-theme="dark"] .recent-article-item {
    background-color: var(--dark-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .nav-article-item:hover,
[data-theme="dark"] .recent-article-item:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* 移动设备优化 */
@media (max-width: 768px) {
    .home-header {
        padding: 1.5rem 1rem;
    }

    .header-logo {
        width: 28px;
        height: 28px;
        margin-bottom: 1rem;
    }

    .site-title {
        font-size: 1.1rem;
        padding-bottom: 8px;
    }

    .home-container {
        padding: 2rem 1rem;
    }

    .category-card {
        transform: none;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .nav-article-item,
    .recent-article-item {
        padding: 0.75rem 0.75rem 0.75rem 1rem;
    }

    .article-date-small {
        font-size: 0.75em;
        padding: 0.15rem 0.4rem;
    }

    .recent-article-item {
        margin-bottom: 0.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.article-header,
.article-description,
#article-content {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.article-header h1 {
    margin: 0 0 1rem 0;
    font-size: 2.2rem;
    color: var(--primary-color);
    line-height: 1.3;
}

.article-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.95rem;
}

.icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.article-description {
    font-size: 1.1rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 1.5rem 0;
    padding: 1.2rem;
    background: var(--background-color);
    border-radius: 1rem;
    border-left: 4px solid var(--primary-color);
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

/* 更新日志特殊样式 */
.update-section {
    margin: 2.5rem 0 1.5rem;
    padding: 0.8rem 1.2rem;
    background: var(--background-color);
    border-radius: 0.8rem;
    color: var(--primary-color);
    font-size: 1.6rem;
}

.module-title {
    margin: 2rem 0 1rem;
    color: var(--secondary-color);
    font-size: 1.3rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.update-item {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.update-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
}

.contributor {
    display: inline-block;
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
    padding: 0.1rem 0.5rem;
    border-radius: 0.3rem;
    font-size: 0.9em;
    margin-left: 0.5rem;
}

/* 暗黑模式适配 */
[data-theme="dark"] .article-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .article-date {
    color: #9ca3af;
}

[data-theme="dark"] .update-section {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .contributor {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-primary);
}

[data-theme="dark"] .update-item::before {
    background: var(--dark-primary);
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    padding: 0.3rem 0.8rem;
    background: var(--background-color);
    color: var(--primary-color);
    border-radius: 2rem;
    font-size: 0.85rem;
    transition: var(--transition-color);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

[data-theme="dark"] .article-description {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .tag {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-primary);
}

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

/* 增强最近文章项的日期标签样式 */
.article-date-small {
    font-size: 0.8em;
    color: var(--text-secondary);
    background-color: rgba(74, 144, 226, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
    transition: var(--transition-color);
    flex-shrink: 0;
}

.recent-article-item:hover .article-date-small {
    background-color: rgba(74, 144, 226, 0.2);
    color: var(--primary-color);
}

[data-theme="dark"] .article-date-small {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .recent-article-item:hover .article-date-small {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--dark-primary);
}

/* 文章列表容器样式增强 */
.recent-articles {
    padding: 1.5rem;
    background-color: rgba(74, 144, 226, 0.03);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

[data-theme="dark"] .recent-articles {
    background-color: rgba(255, 255, 255, 0.02);
}

/* 暗黑模式文章标题颜色适配 */
[data-theme="dark"] .recent-article-item {
    color: #e2e8f0;
}

[data-theme="dark"] .recent-article-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-primary);
}

/* 暗黑模式适配 */
[data-theme="dark"] .search-results {
    background: var(--dark-surface);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .search-result-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

[data-theme="dark"] .search-result-meta {
    color: #9aa0a6;
}

[data-theme="dark"] .search-result-category {
    color: var(--dark-primary);
}

[data-theme="dark"] .search-result-date {
    color: #9aa0a6;
}

[data-theme="dark"] .no-results {
    color: #9aa0a6;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 40px;
}

.header-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 16px;
    background-color: var(--background-color);
    border: none;
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 40px;
    min-width: fit-content;
}

.header-button:hover {
    background-color: var(--primary-color);
    color: white;
}

#language-selector {
    padding-right: 30px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    cursor: pointer;
}

#language-selector:hover {
    background-color: var(--primary-color);
    color: white;
}

.header-search {
    position: relative;
    min-width: 300px;
    flex-grow: 1;
    max-width: 500px;
    height: 40px;
    margin: 10px 0;
}

.header-search .search-box {
    background: var(--background-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    /*padding: 0.25rem 0.25rem 0.25rem 0;*/
    border: 1px solid var(--border-color);
    transition: var(--transition);
    height: 40px;
}

.header-search .search-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.header-search .search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

/* 页脚样式 */
.site-footer {
    background-color: var(--surface-color);
    padding: 2rem 0;
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo-img {
    display: none; /* 隐藏页脚LOGO */
}

.footer-logo span {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 返回顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-top.show {
    opacity: 1;
    transform: translateY(0);
}

.scroll-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px) scale(1.1);
}

/* 暗黑模式适配 */
[data-theme="dark"] .site-footer {
    background-color: var(--dark-surface);
    border-top-color: var(--dark-border);
}

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

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

/* 移动端适配 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-copyright {
        text-align: center;
    }

    .theme-toggle, .scroll-top {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .theme-toggle {
        bottom: 80px;
    }
}

/* 设置boxicons图标居中对齐 */
.bx {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    padding: 4px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 1100;
    border-radius: 4px;
    background-color: var(--background-color);
    transition: var(--transition);
}

.mobile-menu-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .header-buttons {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 0;
        width: 100%;
    }

    .header-buttons.active {
        max-height: 200px;
        margin-top: 10px;
        padding-bottom: 10px;
    }

    .header-button {
        width: 100%;
        justify-content: flex-start;
    }

    #language-selector {
        width: 100%;
    }
}

/* 内容载入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 应用动画到各元素 */
.category-card {
    animation: scaleIn 0.5s ease-out forwards;
    opacity: 0;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
    position: relative;
    overflow: hidden;
}

.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0;
    transform: translate(50%, -50%);
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.category-card:hover::after {
    opacity: 0.1;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
    animation: floatUp 2s infinite ease-in-out;
}

.category-icon {
    z-index: 1;
    position: relative;
}

.header-link {
    position: relative;
}

.site-title {
    position: relative;
}

.site-title::after {
    animation: shimmer 3s infinite linear;
    background: linear-gradient(90deg,
    transparent,
    var(--primary-color),
    transparent);
    background-size: 200% 100%;
}

.theme-toggle:hover {
    animation: pulseGlow 1.5s infinite;
    transform: translateY(-5px);
}

.category-card:hover {
    transform: translateY(-7px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 12px 24px var(--shadow-color);
}

/* 改进页面过渡效果 */
.nav-category-title,
.category-title {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-category-title:hover,
.category-title:hover {
    letter-spacing: 0.02em;
}

/* 确保暗黑模式下的平滑过渡 */
:root {
    --transition-color: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

body,
.container,
.sidebar,
.content,
.category-card,
.nav-article-item,
.recent-article-item,
.header-content {
    transition: var(--transition-color);
}

/* 禁用打印时的动画 */
@media print {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* 全局移动端优化 */
@media (max-width: 768px) {
    /* 防止水平滚动 */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    /* 确保内容框限制宽度不溢出 */
    .container,
    .content,
    .article-content,
    #article-content,
    .home-container,
    .sidebar {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* 优化长文本显示 */
    h1, h2, h3, h4, h5, h6, p, .recent-article-item, .nav-article-item {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* 确保代码块自动换行 */
    pre, code {
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    /* 提高表格在移动端的可访问性 */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 增强顶栏在移动端的可见性和易用性 */
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 1100;
    }

    .header-buttons {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background-color: var(--background-color);
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        display: none;
    }

    .header-buttons.active {
        display: flex;
    }

    /* 让按钮在移动端更容易点击 */
    .header-button,
    #language-selector {
        width: 100%;
        justify-content: flex-start;
        min-height: 44px;
        padding: 0 15px;
        margin: 2px 0;
    }

    /* 图标加大，更易点击 */
    .header-button i {
        font-size: 1.2rem;
        margin-right: 10px;
    }

    /* 优化移动端搜索框 */
    .header-search {
        width: 100%;
        margin: 10px 0;
    }

    /* 移动端菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: transparent;
        border: none;
        width: 44px;
        height: 44px;
        padding: 8px;
        cursor: pointer;
        border-radius: 4px;
        background-color: var(--background-color);
        transition: var(--transition);
    }

    .mobile-menu-toggle .bar {
        display: block;
        width: 24px;
        height: 2px;
        margin: 4px auto;
        background-color: var(--text-color);
        border-radius: 2px;
        transition: var(--transition);
    }

    .mobile-menu-toggle.active .bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

/* 移动端加强 - 特别小的屏幕 */
@media (max-width: 480px) {
    .site-title {
        font-size: 1.1rem;
        padding-right: 50px; /* 为菜单按钮留出空间 */
    }

    .home-header {
        padding: 0.8rem 0.5rem;
    }

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

    .category-title {
        font-size: 1rem;
    }

    .recent-article-item {
        font-size: 0.9rem;
        padding: 8px;
    }

    #article-content {
        padding: 15px;
    }

    #article-content img {
        max-width: 100%;
        height: auto;
    }
}

/* 修复文章条目显示问题 */
.recent-article-item {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .recent-article-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .article-date-small {
        align-self: flex-start;
        margin-left: 0;
    }
}

/* 深色模式适配 */
[data-theme="dark"] .site-title {
    color: #fff;
}

[data-theme="dark"] .header-button,
[data-theme="dark"] #language-selector {
    background-color: var(--dark-surface);
    border-color: var(--dark-border);
    color: #fff;
}

[data-theme="dark"] #language-selector {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
}

[data-theme="dark"] .header-button:hover,
[data-theme="dark"] #language-selector:hover {
    background-color: var(--dark-primary);
    color: white;
    border-color: var(--dark-primary);
}

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

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

[data-theme="dark"] .sidebar,
[data-theme="dark"] .article-item,
[data-theme="dark"] #article-content {
    background-color: var(--dark-surface);
    color: var(--dark-text);
}

[data-theme="dark"] #search-input {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

[data-theme="dark"] .site-title::after {
    background: linear-gradient(90deg, var(--dark-primary) 70%, transparent);
}

[data-theme="dark"] .site-logo {
    filter: brightness(0.9);
}

[data-theme="dark"] .content {
    background: var(--dark-surface);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] #article-content {
    color: var(--dark-text);
}

[data-theme="dark"] #article-content h1,
[data-theme="dark"] #article-content h2,
[data-theme="dark"] #article-content h3 {
    color: var(--dark-primary);
}

[data-theme="dark"] #article-content code {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
}

[data-theme="dark"] #article-content pre {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] #article-content blockquote {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--dark-primary);
}

/* 特定深色模式调整 */
[data-theme="dark"] .category-card {
    background-color: var(--dark-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--dark-primary);
}

[data-theme="dark"] .category-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .category-icon {
    background-color: rgba(74, 144, 226, 0.15);
    color: var(--dark-primary);
}

[data-theme="dark"] .category-card-header::after {
    background: linear-gradient(90deg, var(--dark-primary), transparent);
}

[data-theme="dark"] .recent-articles {
    background-color: rgba(74, 144, 226, 0.05);
}

/* 为文章条目添加动画序列 */
.recent-article-item, .nav-article-item {
    --animation-order: 0;
}

.recent-article-item:nth-child(1), .nav-article-item:nth-child(1) {
    --animation-order: 1;
}

.recent-article-item:nth-child(2), .nav-article-item:nth-child(2) {
    --animation-order: 2;
}

.recent-article-item:nth-child(3), .nav-article-item:nth-child(3) {
    --animation-order: 3;
}

.recent-article-item:nth-child(4), .nav-article-item:nth-child(4) {
    --animation-order: 4;
}

.recent-article-item:nth-child(5), .nav-article-item:nth-child(5) {
    --animation-order: 5;
}

.recent-article-item:nth-child(6), .nav-article-item:nth-child(6) {
    --animation-order: 6;
}

.recent-article-item:nth-child(7), .nav-article-item:nth-child(7) {
    --animation-order: 7;
}

.recent-article-item:nth-child(8), .nav-article-item:nth-child(8) {
    --animation-order: 8;
}

.recent-article-item:nth-child(9), .nav-article-item:nth-child(9) {
    --animation-order: 9;
}

.recent-article-item:nth-child(10), .nav-article-item:nth-child(10) {
    --animation-order: 10;
}

/* 为分类卡片添加动画序列 */
.category-card:nth-child(1) {
    --animation-order: 1;
}

.category-card:nth-child(2) {
    --animation-order: 2;
}

.category-card:nth-child(3) {
    --animation-order: 3;
}

.category-card:nth-child(4) {
    --animation-order: 4;
}

.category-card:nth-child(5) {
    --animation-order: 5;
}

.category-card:nth-child(6) {
    --animation-order: 6;
}

.category-card:nth-child(7) {
    --animation-order: 7;
}

.category-card:nth-child(8) {
    --animation-order: 8;
}

.category-card:nth-child(9) {
    --animation-order: 9;
}

.category-card:nth-child(10) {
    --animation-order: 10;
}
