/* Blog Page Styles */
.blog-page {
    padding: 60px 0;
    background-color: var(--color-background);
}

/* Page Header */
.page-header {
    margin-bottom: 60px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-content {
    max-width: 800px;
}

.subtitle {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text);
}

.results-count {
    font-size: 1rem;
    color: var(--color-text-light);
}

/* Filters Section */
.filters-section {
    margin-bottom: 40px;
}

.filters-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 1.5rem;
}

.filter-group {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-group h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 1rem;
    color: var(--color-text);
    margin-right: 8px;
}

.count {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* Blog Container */
.blog-container {
    position: relative;
    width: 100%;
    min-height: 400px;
}

/* States Container */
.states-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    z-index: 10;
}

/* Loading State */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
}

.error-state img {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

.retry-btn {
    padding: 0.5rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.retry-btn:hover {
    background-color: #2980b9;
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
}

.empty-state img {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

.clear-filters-btn {
    padding: 0.5rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.clear-filters-btn:hover {
    background-color: #2980b9;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* 当显示状态时隐藏博客网格 */
.states-container:not([style*="display: none"]) + .blog-grid {
    display: none;
}

/* Blog Card */
.blog-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-link {
    text-decoration: none;
    color: inherit;
}

.card-image {
    position: relative;
    padding-top: 66.67%; /* 3:2 Aspect Ratio */
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 24px;
}

.card-category {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 16px;
}

.read-more {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--color-primary-dark);
}

/* Load More Button */
.load-more {
    text-align: center;
}

.btn-primary {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: var(--color-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .page-header {
        flex-direction: column;
    }

    .results-count {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    .blog-page {
        padding: 40px 0;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card {
    animation: fadeIn 0.6s ease forwards;
}

/* Stagger Animation for Cards */
.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

/**
 * Blog List Page Styles
 */

/* 页面过渡动画 */
body {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* 博客卡片样式 */
.blog-card {
    background: #2a2a4a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-image {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
}

.card-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.4;
}

.card-description {
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 4.8em; /* 3行 * 1.6行高 */
}

.read-more {
    color: #00ffff;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.blog-card:hover .read-more {
    transform: translateX(5px);
}

/* 加载动画 */
.loading-indicator {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 255, 0.1);
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 卡片加载状态 */
.blog-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.blog-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 搜索框样式 */
.search-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #3a3a5a;
    border-radius: 8px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.2);
}

/* 过滤器样式 */
.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-option:hover {
    background: rgba(0, 255, 255, 0.1);
}

.filter-option input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #3a3a5a;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.filter-option input[type="checkbox"]:checked {
    background: #00ffff;
    border-color: #00ffff;
}

.filter-option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1a1a2e;
    font-size: 12px;
}

/* 动画类 */
/* .fade-in {
    animation: fadeIn 0.5s ease-in-out;
} */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card-title {
        font-size: 1.3rem;
    }
    
    .card-content {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .card-category {
        font-size: 0.8rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .card-description {
        font-size: 0.9rem;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #999;
}

.pagination-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 20px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
} 