/* Index Page Styles - 首页样式 */

/* Homepage Intro Section */
.site-intro {
    background: linear-gradient(135deg, #6a70d9 0%, #7a5ecc 100%) !important;
    color: #ffffff !important;
    padding: 2rem 0;
    border-radius: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
}

.site-intro * {
    color: #ffffff !important;
}

.intro-content {
    position: relative;
    z-index: 2;
}

.intro-content h1 {
    font-size: 2.5rem !important;
    margin-bottom: 1rem;
    font-weight: bold;
    color: #ffffff !important;
}

.intro-text {
    font-size: 1.2rem !important;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #ffffff !important;
}

.intro-emojis {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.floating-emoji {
    display: inline-block;
    margin: 0 0.5rem;
    animation: float 3s ease-in-out infinite;
}

.floating-emoji:nth-child(2) {
    animation-delay: 0.5s;
}

.floating-emoji:nth-child(3) {
    animation-delay: 1s;
}

.floating-emoji:nth-child(4) {
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    margin: 0 0 1.5rem 0;
    color: #333;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    width: 50px;
    height: 3px;
    background: #007bff;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Popular Emojis Section - 热门表情模块 */
.popular-emojis-section {
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

/* Category Section - 子分类模块 */
.category-section {
    border-radius: 15px;
    margin-bottom: 2rem;
}

.category-section:last-child {
    margin-bottom: 0;
}

/* Latest Posts Section - 最新文章模块 */
.latest-posts-section {
    background: #ffffff;
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    margin: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.category-title {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
}

.more-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 1px solid #007bff;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.more-link:hover {
    background: #007bff;
    color: white;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    gap: 2rem;
    margin: 1.5rem 0 0 0;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    justify-content: center;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.post-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-item:hover {
    transform: translateY(-5px);
}

.post-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
    flex: 0 0 auto;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 1rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
    line-height: 1.4;
    flex: 0 0 auto;
}

.post-title a {
    color: #333;
    text-decoration: none;
}

.post-title a:hover {
    color: #007bff;
}

.post-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
}

/* Emoji Grid */
.emoji-grid {
    display: grid;
    gap: 20px;
    margin: 1.5rem 0 0 0;
    justify-content: center;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.emoji-item {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1; /* 确保正方形 */
    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);
}

.emoji-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);
}

.emoji-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.emoji-link:hover {
    text-decoration: none;
    color: inherit;
}

.emoji-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;
}

.emoji-name {
    font-size: 18px;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .emoji-grid {
        gap: 15px;
        max-width: 100%;
        width: 100%;
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .emoji-item {
        min-width: 130px;
        min-height: 130px;
        background: rgba(255, 255, 255, 0.85);
        border-radius: 10px;
    }
    
    .emoji-character {
        font-size: 56px;
        width: 56px;
        height: 56px;
    }
    
    .emoji-name {
        font-size: 16px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    /* 添加平板端的内容内边距调整 */
    .site-intro {
        padding: 2rem 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .intro-content h1 {
        font-size: 2rem;
    }
    
    .intro-text {
        font-size: 1rem;
    }
    
    /* 移动端缩小内边距，避免双重内边距 */
    .site-intro {
        padding: 2rem 0;
        margin: 0;
        border-radius: 0;
    }
    
    /* 修复移动端分类标题和"更多"按钮的对齐问题 */
    .category-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #f0f0f0;
    }
    
    /* 移动端表情网格布局 - 确保一行显示3个表情，且为正方形 */
    .emoji-grid {
        display: grid !important;
        gap: 8px !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important; /* 移除额外内边距 */
        width: 100% !important;
        box-sizing: border-box !important;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }
    
    .emoji-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-width: auto !important;
        min-height: auto !important;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .emoji-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);
    }
    
    .emoji-item > * {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        text-decoration: none;
    }
    
    .emoji-character {
        font-size: 48px !important; /* 修改为48px字体大小 */
        width: 48px !important; /* 修改为48px宽度 */
        height: 48px !important; /* 修改为48px高度 */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .emoji-name {
        font-size: 14px !important; /* 修改为14px字体大小 */
        margin-top: 0.2rem !important;
    }
    
    /* 修复移动端模块内边距 */
    .popular-emojis-section, 
    .category-section,
    .latest-posts-section {
        padding: 1rem 0;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
        max-width: 100%;
        width: 100%;
    }
    
    /* 移动端缩小内边距，避免双重内边距 */
    .site-intro {
        padding: 1.5rem 0;
        margin: 0;
        border-radius: 0;
    }
    
    /* 小屏幕设备也保持一行3个表情，但尺寸略小 */
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
        gap: 6px !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important; /* 移除额外内边距 */
        width: 100% !important;
    }
    
    .emoji-item {
        padding: 0.25rem !important;
        width: 100% !important;
        height: auto !important; /* 移除固定高度 */
        border-radius: 6px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        background: rgba(255, 255, 255, 0.9);
    }
    
    .emoji-item:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    
    .emoji-character {
        font-size: 48px !important; /* 修改为48px字体大小 */
        width: 48px !important; /* 修改为48px宽度 */
        height: 48px !important; /* 修改为48px高度 */
    }
    
    .emoji-name {
        font-size: 14px !important; /* 修改为14px字体大小 */
        margin-top: 0.15rem !important;
    }
    
    .posts-grid {
        gap: 1rem;
    }
}