/* Archive and Category Styles */

/* Archive Emoji Styles */
.archive-emoji-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.archive-emoji-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.archive-emoji-description {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Subcategory Section */
.subcategory-section {
    background: transparent; /* 移除白色背景 */
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.subcategory-section:last-child {
    margin-bottom: 0;
}

.subcategory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.subcategory-title {
    font-size: 1.5rem;
    margin: 0;
    color: #333;
}

.subcategory-count {
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Archive Grid */
.archive-grid {
    display: grid;
    gap: 20px;
    margin: 0;
    justify-content: center;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.archive-item {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    aspect-ratio: 1/1; /* Ensure square */
    min-width: 150px;
    min-height: 150px;
    width: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.archive-item:hover {
    transform: translateY(-10px) scale(1.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.archive-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.archive-link:hover {
    text-decoration: none;
    color: inherit;
}

.archive-character {
    font-size: 64px;
    line-height: 1;
    cursor: pointer;
    user-select: all;
    margin-bottom: 0.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.archive-name {
    font-size: 18px;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Archive Stats */
.archive-stats {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Single Post Styles */
.single-post-header {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.single-post-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.single-post-meta {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.single-post-content {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.8;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .archive-grid {
        gap: 15px;
        max-width: 100%;
        width: 100%;
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .archive-item {
        min-width: 130px;
        min-height: 130px;
        background: rgba(255, 255, 255, 0.85);
        border-radius: 10px;
    }
    
    .archive-character {
        font-size: 56px;
        width: 56px;
        height: 56px;
    }
    
    .archive-name {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .archive-emoji-title,
    .single-post-title {
        font-size: 2rem;
    }
    
    .archive-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 15px !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 10px !important;
    }
    
    .archive-item {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1/1 !important;
        position: relative !important;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 0.3rem !important;
        min-height: auto !important;
        min-width: auto !important;
        box-sizing: border-box !important;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .archive-item:hover {
        transform: translateY(-5px) scale(1.03);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
        background: rgba(255, 255, 255, 0.95);
    }
    
    .archive-character {
        font-size: 48px !important;
        width: 48px !important;
        height: 48px !important;
    }
    
    .archive-name {
        font-size: 16px !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        line-height: 1.3 !important;
        max-height: 2.6em !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .single-post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* 小屏幕设备也保持一行3个表情，但尺寸略小 */
    .archive-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 5px !important;
    }
    
    .archive-item {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1/1 !important;
        position: relative !important;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 6px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        padding: 0.25rem !important;
        min-height: auto !important;
        min-width: auto !important;
        box-sizing: border-box !important;
    }
    
    .archive-item:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    
    .archive-character {
        font-size: 36px !important;
        width: 36px !important;
        height: 36px !important;
    }
    
    .archive-name {
        font-size: 14px !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        line-height: 1.3 !important;
        max-height: 2.6em !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}