/* Theme 5: Dark Mode - 深色模式 */
/* 深色背景、高对比度、护眼设计 */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.7;
}

.header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.logo {
    color: #60a5fa;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.nav a {
    color: #94a3b8;
    transition: color 0.2s;
}

.nav a:hover {
    color: #60a5fa;
}

.main {
    background: #0f172a;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.post-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px; /* 统一圆角设计，与整体风格一致 */
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    will-change: transform, box-shadow;
    overflow: hidden;
}

.post-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    object-fit: cover;
    border-radius: 8px;
}

.post-card:hover img {
    transform: scale(1.05);
}

.post-card:hover {
    background: #334155;
    border-color: #60a5fa;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(96, 165, 250, 0.2);
}

.post-card h3 {
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background: none !important;
    background-clip: unset !important;
}

.post-card h3 a {
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background: none !important;
    background-clip: unset !important;
    text-decoration: none !important;
}

.post-card h3 a:hover {
    color: #60a5fa !important;
    -webkit-text-fill-color: #60a5fa !important;
    background: none !important;
    background-clip: unset !important;
}

.post-card p {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
    background: none !important;
    background-clip: unset !important;
}

.post-card .post-meta {
    color: #64748b;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    will-change: transform, box-shadow;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.post-detail {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px; /* 统一圆角设计，与整体风格一致 */
    padding: 3rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.post-header h1 {
    color: #e2e8f0;
    font-size: 2.5rem;
    font-weight: 700;
}

.post-content {
    color: #cbd5e1;
}

.post-content h2 {
    color: #e2e8f0 !important;
}

.post-content h3 {
    color: #e2e8f0 !important;
}

.post-content p {
    color: #cbd5e1 !important;
}

.post-content blockquote {
    color: #94a3b8 !important;
    border-left-color: #60a5fa !important;
}

.post-meta {
    color: #94a3b8 !important;
}

.post-meta span {
    color: #94a3b8 !important;
}

.excerpt {
    color: #cbd5e1 !important;
}

.post-share h3 {
    color: #e2e8f0 !important;
}

.post-tags h3 {
    color: #e2e8f0 !important;
}

.comments-header h2 {
    color: #e2e8f0 !important;
}

.comment-sort label {
    color: #cbd5e1 !important;
}

.comment-login-prompt {
    color: #cbd5e1 !important;
}

.comment-login-prompt a {
    color: #60a5fa !important;
}

.no-comments {
    color: #94a3b8 !important;
}

.comment-form {
    background: #1e293b;
    border: 1px solid #334155;
}

.comment-item {
    background: #1e293b;
    border-left: 3px solid #60a5fa;
    border: 1px solid #334155;
}

.category {
    background: #334155;
    color: #60a5fa;
}

.tag {
    background: #334155;
    color: #94a3b8;
    border: 1px solid #475569;
    transition: all 0.3s ease;
    will-change: transform, background;
}

.tag:hover {
    background: #475569;
    border-color: #60a5fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(96, 165, 250, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-card {
        padding: 1.5rem;
    }
    
    .post-card h3 {
        font-size: 1.25rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    .post-detail {
        padding: 2rem 1.5rem;
    }
    
    .header {
        padding: 1.25rem 0;
    }
    
    .logo {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .post-card {
        padding: 1.25rem;
    }
    
    .post-header h1 {
        font-size: 1.75rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
}

/* Hero区域适配 */
.hero {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-radius: 16px; /* 统一圆角设计，与整体风格一致 */
}

.hero h1 {
    color: #e2e8f0 !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3) !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background: none !important;
    background-clip: unset !important;
}

.hero-subtitle {
    color: #cbd5e1 !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2) !important;
}

/* 分享按钮适配 */
.share-btn-inline {
    background: #1e293b;
    border: 2px solid #334155;
    color: #94a3b8;
}

.share-btn-inline:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.share-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.share-twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.share-linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

.share-whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
}

.share-copy:hover {
    background: #10b981;
    border-color: #10b981;
}

/* 评论表单适配 */
.comment-form {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px; /* 统一圆角设计，与整体风格一致 */
}

/* 评论项适配 */
.comment-item {
    background: #1e293b;
    border-left: 4px solid #60a5fa;
    border: 1px solid #334155;
    border-radius: 16px; /* 统一圆角设计，与整体风格一致 */
}

/* 回复指示器适配 - 深色主题 */
.comment-reply-indicator {
    color: #e2e8f0 !important;
    background: rgba(96, 165, 250, 0.2) !important;
    border-color: #60a5fa !important;
}

.comment-item:hover {
    background: #334155;
    transform: translateX(4px);
    box-shadow: 0 8px 16px rgba(96, 165, 250, 0.2);
}

/* 标签适配 */
.tag:hover {
    background: #475569;
    border-color: #60a5fa;
}

/* 表单输入框适配 */
.form-group input,
.form-group textarea {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
    background: #0f172a;
}

/* 代码块适配 */
.post-content pre {
    background: #0f172a;
    border: 1px solid #334155;
}

.post-content pre::before {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

.post-content code {
    background: #334155;
    color: #fca5a5;
    border: 1px solid #475569;
}

/* Reading progress bar - Dark theme */
.reading-progress {
    background: rgba(30, 41, 59, 0.5);
}

.reading-progress-bar {
    background: linear-gradient(90deg, #60a5fa, #8b5cf6);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
}

/* Reading time - Dark theme */
.reading-time {
    color: #94a3b8;
}

/* Table of contents - Dark theme */
.post-toc {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px; /* 统一圆角设计，与整体风格一致 */
}

.post-toc h3 {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

.toc-link {
    color: #94a3b8;
}

.toc-link:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border-left-color: #60a5fa;
}

.toc-link.active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    border-left-color: #60a5fa;
}

.toc-level-4 .toc-link {
    color: #64748b;
}

/* ========================================
   首页文字元素可见性修复 - Dark Theme
   确保所有文字在所有情况下都清晰可见
   ======================================== */

/* Featured Article 标题 */
.featured-post h2 {
    color: #e2e8f0 !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8) !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background: none !important;
    background-clip: unset !important;
}

/* Latest Articles 标题 */
.posts h2,
.main-content .posts h2 {
    color: #e2e8f0 !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8) !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background: none !important;
    background-clip: unset !important;
}

/* 侧边栏标题 */
.sidebar-widget h3 {
    color: #e2e8f0 !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5) !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background: none !important;
    background-clip: unset !important;
}

/* 文章卡片标题 */
.post-card h3 {
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background: none !important;
    background-clip: unset !important;
}

.post-card h3 a {
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background: none !important;
    background-clip: unset !important;
    text-decoration: none !important;
}

.post-card h3 a:hover {
    color: #60a5fa !important;
    -webkit-text-fill-color: #60a5fa !important;
    background: none !important;
    background-clip: unset !important;
}

/* 文章卡片内容 */
.post-card p {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    background: none !important;
    background-clip: unset !important;
}

.post-card .post-content p {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    background: none !important;
    background-clip: unset !important;
}

/* 文章元数据 */
.post-meta {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
    background: none !important;
    background-clip: unset !important;
}

.post-meta span {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
    background: none !important;
    background-clip: unset !important;
}

/* 侧边栏 - 深色主题下白框内的文字需要更深的颜色以提高对比度 */
.sidebar {
    border-radius: 16px !important; /* 统一圆角设计 */
}

.sidebar-widget h3 {
    color: #111827 !important; /* 深色文字，适合白色背景 */
    -webkit-text-fill-color: #111827 !important;
    background: none !important;
    background-clip: unset !important;
    font-weight: 700 !important; /* 增加字重，提高可读性 */
}

/* 侧边栏链接 */
.sidebar-widget a {
    color: #374151 !important; /* 深灰色文字，适合白色背景，提高对比度 */
    -webkit-text-fill-color: #374151 !important;
    background: none !important;
    background-clip: unset !important;
    text-decoration: none !important;
    font-weight: 500 !important; /* 增加字重 */
}

.sidebar-widget a:hover {
    color: #2563eb !important; /* 使用蓝色作为悬停色，更清晰 */
    -webkit-text-fill-color: #2563eb !important;
    background: none !important;
    background-clip: unset !important;
}

/* 侧边栏文本 */
.sidebar-widget p {
    color: #4b5563 !important; /* 深灰色文字，适合白色背景 */
    -webkit-text-fill-color: #4b5563 !important;
    background: none !important;
    background-clip: unset !important;
    line-height: 1.7 !important;
}

/* 分类标签 */
.category-tag {
    color: #e2e8f0 !important;
    background: #334155 !important;
    border-color: #475569 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
}

.category-tag:hover {
    color: #60a5fa !important;
    -webkit-text-fill-color: #60a5fa !important;
}

/* 分类标签 */
.category {
    color: #60a5fa !important;
    -webkit-text-fill-color: #60a5fa !important;
    background: none !important;
    background-clip: unset !important;
}

/* 特色文章卡片内容 - 深色主题下白框内的文字需要更深的颜色以提高对比度 */
.post-card.featured {
    border-radius: 16px !important; /* 统一圆角设计 */
}

.post-card.featured h3,
.post-card.featured h3 a {
    color: #111827 !important; /* 深色文字，适合白色背景 */
    -webkit-text-fill-color: #111827 !important;
    background: none !important;
    background-clip: unset !important;
    font-weight: 700 !important; /* 增加字重，提高可读性 */
}

.post-card.featured p {
    color: #374151 !important; /* 深灰色文字，适合白色背景，提高对比度 */
    -webkit-text-fill-color: #374151 !important;
    background: none !important;
    background-clip: unset !important;
    line-height: 1.7 !important;
}

.post-card.featured .post-meta {
    color: #6b7280 !important; /* 中等灰色，适合白色背景 */
    -webkit-text-fill-color: #6b7280 !important;
    background: none !important;
    background-clip: unset !important;
}
