/**
 * Archives页面样式 - 全站归档和站点地图
 * Version: v1.0
 * 优化: SEO + 用户体验
 */

/* ========== 归档页面统计卡片 ========== */
.archive-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.stat-number {
    font-size: 42px;
    font-weight: bold;
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== Tab切换导航 ========== */
.archive-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
}

.archive-tab {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 0 0 auto;
}

.archive-tab:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}

.archive-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ========== 归档内容区域 ========== */
.archive-content {
    min-height: 400px;
}

.archive-section {
    display: none;
    animation: fadeIn 0.4s ease-in;
}

.archive-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 按分类归档 ========== */
.category-group {
    margin-bottom: 40px;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #f3f4f6;
}

.category-icon {
    font-size: 32px;
    margin-right: 15px;
}

.category-info h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: #1f2937;
}

.category-count {
    color: #6b7280;
    font-size: 14px;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.article-card {
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.article-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    background: white;
    transform: translateY(-2px);
}

.article-card a {
    text-decoration: none;
    color: #1f2937;
    display: block;
}

.article-title {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-date {
    font-size: 12px;
    color: #9ca3af;
}

/* ========== 按时间归档 ========== */
.timeline-archive {
    position: relative;
    padding-left: 40px;
}

.timeline-archive::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.year-group {
    margin-bottom: 40px;
}

.year-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.year-marker {
    position: absolute;
    left: -40px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.year-title {
    font-size: 32px;
    font-weight: bold;
    color: #1f2937;
    margin-left: 10px;
}

.month-group {
    margin-bottom: 25px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.month-title {
    font-size: 18px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

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

.article-item {
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}

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

.article-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #1f2937;
    transition: color 0.3s ease;
}

.article-item a:hover {
    color: #6366f1;
}

.article-item a:hover .article-name {
    transform: translateX(5px);
}

.article-name {
    flex: 1;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.article-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 12px;
    color: #9ca3af;
}

/* ========== 搜索功能 ========== */
.archive-search {
    margin-bottom: 30px;
    position: relative;
}

.archive-search input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.archive-search input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 20px;
}

.search-results {
    margin-top: 20px;
    padding: 15px;
    background: #fef3c7;
    border-radius: 8px;
    color: #92400e;
    font-size: 14px;
}

/* ========== 加载状态 ========== */
.loading-skeleton {
    padding: 20px;
}

.skeleton-line {
    height: 20px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 15px;
}

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

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .archive-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-number {
        font-size: 32px;
    }

    .archive-tabs {
        gap: 8px;
    }

    .archive-tab {
        padding: 8px 15px;
        font-size: 13px;
    }

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

    .year-title {
        font-size: 24px;
    }

    .timeline-archive {
        padding-left: 30px;
    }

    .year-marker {
        left: -30px;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .archive-stats {
        grid-template-columns: 1fr;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
}
