/* 文学主题 - 优雅阅读风格 */
:root {
    /* 全新主色调 - 文学风格 */
    --primary-color: #8B4513;
    --primary-dark: #654321;
    --primary-light: #A67C52;
    --secondary-color: #D2B48C;
    --accent-color: #C19A6B;
    --light-color: #F5F5DC;
    --dark-color: #3E2723;
    --text-color: #4A4A4A;
    --text-light: #8E8E8E;
    --border-color: #E8E0D5;
    --shadow: 0 4px 20px rgba(139, 69, 19, 0.1);
    --shadow-hover: 0 8px 30px rgba(139, 69, 19, 0.15);
    
    /* 字体变量 */
    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 16px;
    --line-height: 1.8;
    
    /* 布局变量 */
    --max-width: 1200px;
    --content-width: 800px;
    --sidebar-width: 350px;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    line-height: var(--line-height);
    color: var(--text-color);
    background: linear-gradient(135deg, #f8f4e9 0%, #f1e8d8 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器和布局 */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.main-layout {
    display: flex;
    gap: 40px;
    margin: 40px 0;
    min-height: calc(100vh - 200px);
}

.content-area {
    flex: 1;
    max-width: var(--content-width);
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
        gap: 30px;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
    }
}

/* 头部样式 */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: 1px;
    transition: var(--transition);
}

.site-logo:hover {
    transform: translateY(-2px);
}

.site-description {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
}

/* 导航菜单 */
.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 25px;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: white;
}

/* 文章卡片 */
.article-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    margin-bottom: 30px;
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 69, 19, 0.05), transparent);
    transition: left 0.5s ease;
}

.article-card:hover::before {
    left: 100%;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.article-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    line-height: 1.4;
    color: var(--dark-color);
}

.article-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-title a:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: var(--light-color);
    border-radius: 15px;
}

.article-excerpt {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--dark-color);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

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

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    transition: var(--transition);
}

.read-more:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* 侧边栏组件 */
.sidebar-widget {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.sidebar-widget:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.widget-title {
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary-color);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

/* 搜索框 */
.search-form {
    display: flex;
    margin-bottom: 0;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--light-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.search-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.search-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* 分类列表 */
.category-list {
    list-style: none;
}

.category-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.category-item:hover {
    background: var(--light-color);
    margin: 0 -30px;
    padding: 15px 30px;
    border-radius: 4px;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.category-link:hover {
    color: var(--primary-color);
}

.category-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 文章列表组件 */
.post-list-widget {
    list-style: none;
}

.post-list-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.post-list-item:hover {
    background: var(--light-color);
    margin: 0 -30px;
    padding: 15px 30px;
    border-radius: 4px;
}

.post-list-link {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.post-list-link:hover {
    color: var(--primary-color);
}

.post-list-title {
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.4;
    font-weight: 600;
}

.post-list-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 投稿组件 */
.contribution-widget {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    padding: 40px 30px;
    border-radius: var(--border-radius);
}

.contribution-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.contribution-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.contribution-desc {
    margin-bottom: 25px;
    opacity: 0.9;
    line-height: 1.6;
}

.contribution-email {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.contribution-email:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 10px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

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

.page-current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

/* 文章详情页 */
.article-content {
    font-size: 1.1rem;
    line-height: 1.9;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-content h2 {
    font-size: 1.6rem;
    margin: 40px 0 20px;
    color: var(--dark-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

.article-content h3 {
    font-size: 1.3rem;
    margin: 30px 0 15px;
    color: var(--dark-color);
}

.article-content p {
    margin-bottom: 25px;
    text-align: justify;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 25px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-light);
    background: var(--light-color);
    padding: 20px 25px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.article-content ul, .article-content ol {
    margin: 25px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.article-content img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* 页脚 */
.site-footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2c1810 100%);
    color: white;
    padding: 50px 0 20px;
    margin-top: 80px;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget {
    flex: 1;
    min-width: 250px;
}

.footer-widget-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    padding: 5px 0;
    display: block;
}

.footer-links a:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* 友情链接样式 */
.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.friend-link {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.friend-link:hover {
    background: var(--secondary-color);
    color: var(--dark-color);
    transform: translateY(-2px);
}

/* 工具类 */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.py-3 { padding: 30px 0; }
.py-4 { padding: 40px 0; }
.lead { font-size: 1.1rem; font-weight: 300; }

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

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

.slide-in {
    animation: slideIn 0.6s ease-out;
}

/* 回到顶部按钮 */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.scroll-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px) scale(1.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .article-card {
        padding: 25px;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .article-meta {
        gap: 10px;
    }
    
    .meta-item {
        font-size: 0.8rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .sidebar-widget {
        padding: 25px;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .article-card {
        padding: 20px;
    }
    
    .article-title {
        font-size: 1.3rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .article-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* 打印样式 */
@media print {
    .site-header, .sidebar, .site-footer {
        display: none;
    }
    
    .article-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 选择文本样式 */
::selection {
    background: var(--secondary-color);
    color: var(--dark-color);
}

::-moz-selection {
    background: var(--secondary-color);
    color: var(--dark-color);
}
/* 新增：确保加载动画可以被隐藏 */
.loading-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

/* 新增：强制显示主要内容 */
body {
    opacity: 1 !important;
}