/* 博客页面特定样式 - 暗黑模式 */
.blog-main {
    margin-top: 70px;
    padding: 40px 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #0e4b99 100%);
    position: relative;
}

.blog-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.8; transform: scale(1.1) rotate(180deg); }
}

.blog-header {
    text-align: center;
    padding: 60px 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.blog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.blog-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.blog-title i {
    background: linear-gradient(45deg, var(--accent-color), #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* 博客过滤器 */
.blog-filters {
    padding: 0 20px 40px;
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.category-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box input:focus {
    outline: none;
    border-color: var(--text-light);
    background: rgba(255, 255, 255, 0.3);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
}

/* 博客文章网格 */
.blog-posts {
    padding: 0 20px;
}

.posts-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* 文章卡片 - 暗黑模式 */
.post-card {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.post-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 0 50px rgba(120, 119, 198, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.post-card:hover::before {
    opacity: 1;
}

.post-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
}

.post-category {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    backdrop-filter: blur(10px);
}

.post-category.tech {
    background: rgba(102, 126, 234, 0.8);
}

.post-category.setup {
    background: rgba(79, 172, 254, 0.8);
}

.post-category.apps {
    background: rgba(78, 205, 196, 0.8);
}

.post-content {
    padding: 25px;
    position: relative;
    z-index: 2;
}

.post-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.post-excerpt {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    white-space: nowrap;
}

.post-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(120, 119, 198, 0.8), rgba(255, 119, 198, 0.6));
    color: #ffffff;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tag:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(120, 119, 198, 1), rgba(255, 119, 198, 0.8));
    box-shadow: 0 4px 12px rgba(120, 119, 198, 0.4);
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--accent-color);
    gap: 12px;
}

/* 加载更多 */
.load-more-container {
    text-align: center;
    padding: 40px 20px;
}

/* 过滤动画 */
.post-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.post-card.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .category-filters {
        justify-content: center;
    }

    .search-box {
        min-width: auto;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-meta {
        flex-direction: column;
        gap: 10px;
    }

    .blog-header {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .blog-filters {
        padding: 0 15px 30px;
    }

    .blog-posts {
        padding: 0 15px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .post-content {
        padding: 20px;
    }

    .category-filters {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .blog-title {
        flex-direction: column;
        gap: 10px;
    }
}

/* 文章模态框样式 */
.post-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.post-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 95%;
    margin: 2.5% auto;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    transform: translateY(50px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.post-modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.post-article {
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.post-hero {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.post-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px;
    color: white;
}

.post-hero-content .post-category {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px;
    background: var(--primary-color);
    color: white;
}

.post-hero-content .post-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.post-hero-content .post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.post-hero-content .post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-hero-content .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-hero-content .tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.8rem;
    color: white;
    backdrop-filter: blur(10px);
}

.post-body {
    padding: 40px;
}

.post-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
    color: #333333;
    font-size: 1.1rem;
    padding: 0 20px;
    background: #ffffff;
}

/* 改进阅读体验 */
.post-article {
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
}

.post-article::-webkit-scrollbar {
    width: 8px;
}

.post-article::-webkit-scrollbar-track {
    background: transparent;
}

.post-article::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(168, 85, 247, 0.6));
    border-radius: 4px;
}

.post-article::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(168, 85, 247, 0.8));
}

/* Markdown内容样式 */
.post-content-wrapper h1,
.post-content-wrapper h2,
.post-content-wrapper h3,
.post-content-wrapper h4,
.post-content-wrapper h5,
.post-content-wrapper h6 {
    margin: 2em 0 1em;
    font-weight: 600;
    line-height: 1.3;
    color: #222222;
}

.post-content-wrapper h1 {
    font-size: 2.2rem;
    border-bottom: 3px solid #3b82f6;
    padding-bottom: 10px;
    color: #1e40af;
}

.post-content-wrapper h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid #6366f1;
    padding-bottom: 8px;
    color: #3730a3;
}

.post-content-wrapper h3 {
    font-size: 1.5rem;
    color: #3b82f6;
}

.post-content-wrapper h4 {
    font-size: 1.3rem;
    color: #6366f1;
}

.post-content-wrapper p {
    margin: 1.5em 0;
    text-align: justify;
    color: #444444;
}

.post-content-wrapper ul,
.post-content-wrapper ol {
    margin: 1.5em 0;
    padding-left: 2em;
    color: #555555;
}

.post-content-wrapper li {
    margin: 0.5em 0;
    color: #555555;
}

.post-content-wrapper blockquote {
    margin: 2em 0;
    padding: 20px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    position: relative;
    color: #555555;
}

.post-content-wrapper blockquote::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-color);
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
}

.post-content-wrapper code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

.post-content-wrapper pre {
    background: #1a1a1a;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2em 0;
    position: relative;
}

.post-content-wrapper pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-content-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-content-wrapper th,
.post-content-wrapper td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.post-content-wrapper th {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

.post-content-wrapper tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.post-content-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2em 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.post-content-wrapper a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.post-content-wrapper a:hover {
    border-bottom-color: #3b82f6;
}

/* 模态框响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }
    
    .post-hero {
        height: 200px;
    }
    
    .post-hero-overlay {
        padding: 20px;
    }
    
    .post-hero-content .post-title {
        font-size: 1.5rem;
    }
    
    .post-hero-content .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .post-body {
        padding: 20px;
    }
    
    .post-content-wrapper {
        font-size: 0.95rem;
    }
    
    .post-content-wrapper h1 {
        font-size: 1.8rem;
    }
    
    .post-content-wrapper h2 {
        font-size: 1.5rem;
    }
    
    .post-content-wrapper h3 {
        font-size: 1.3rem;
    }
    
    .post-content-wrapper pre {
        padding: 15px;
        font-size: 0.8rem;
    }
    
    .post-content-wrapper table {
        font-size: 0.9rem;
    }
    
    .post-content-wrapper th,
    .post-content-wrapper td {
        padding: 8px 10px;
    }
}