/* Sidebar Styles - 侧边栏样式 */

.widget {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.widget-title {
    font-size: 1.3rem;
    color: #333;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

/* 表情小工具网格样式 */
.emoji-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.emoji-mini-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    aspect-ratio: 1/1; /* 使背景框为正方形 */
    justify-content: center;
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.emoji-mini-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.emoji-mini-character {
    font-size: 36px; /* 放大50% (从24px到36px) */
    margin-bottom: 0.25rem;
    user-select: all;
}

.emoji-mini-name {
    font-size: 12px;
    color: #666;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* 表情包小工具网格样式 */
.sticker-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.sticker-mini-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    aspect-ratio: 1/1; /* 使背景框为正方形 */
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.sticker-mini-item:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-5px) scale(1.06);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.sticker-mini-image {
    width: 100%;
    height: 95%; /* 改为95% */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.sticker-mini-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sticker-mini-placeholder {
    font-size: 24px;
    line-height: 1;
    text-align: center;
    user-select: all;
}

.sticker-mini-name {
    display: none; /* 不显示表情包名称 */
}

/* 分类列表样式 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    color: #007bff;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    transition: all 0.3s ease;
}

.category-list a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 标签云样式 */
.tag-cloud {
    line-height: 1.8;
}

.tag-cloud a {
    display: inline-block;
    background: #f0f0f0; /* 灰色背景 */
    color: #000000; /* 黑色字体 */
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem !important;
    margin: 0.25rem;
    transition: all 0.3s ease;
}

.tag-cloud a:before {
    content: "#"; /* 标签名称前面是#号 */
    color: #007bff !important; /* 蓝色的#号 */
    margin-right: 0.25rem;
}

.tag-cloud a:hover {
    background: #007bff; /* 背景是蓝色 */
    color: white; /* 字体是白色 */
}

.tag-cloud a:hover:before {
    color: #ffffff !important; /* #号在悬停时为白色 */
}

/* 标签列表样式 */
.tag-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tag-list li {
    margin-bottom: 0.5rem;
}

.tag-item {
    display: inline-block;
    background: #f0f0f0; /* 灰色背景 */
    color: #000000; /* 黑色字体 */
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    margin: 0.25rem;
    transition: all 0.3s ease;
}

.tag-item:before {
    content: "#"; /* 标签名称前面是#号 */
    color: #007bff !important; /* 蓝色的#号 */
    margin-right: 0.25rem;
}

.tag-item:hover {
    background: #007bff; /* 背景是蓝色 */
    color: white; /* 字体是白色 */
}

.tag-item:hover:before {
    color: #ffffff !important; /* #号在悬停时为白色 */
}

/* Desktop Responsive */
@media (min-width: 1200px) {
    .emoji-mini-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 12px;
    }
    
    .sticker-mini-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }
}

/* Medium screens */
@media (max-width: 1199px) and (min-width: 769px) {
    .emoji-mini-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 8px;
    }
    
    .sticker-mini-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .widget {
        padding: 1rem;
    }
    
    .widget-title {
        font-size: 1.2rem;
    }
    
    /* 在移动端保持表情包小工具一行显示2个 */
    .sticker-mini-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .sticker-mini-image {
        height: 80%; /* 保持正方形 */
    }
    
    /* 移动端表情小工具也保持正方形 */
    .emoji-mini-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .emoji-mini-character {
        font-size: 2.25rem; /* 保持放大后的大小 */
    }
    
    /* 移动端标签样式 */
    .tag-cloud a,
    .tag-item {
        font-size: 0.8rem !important;
        padding: 0.2rem 0.6rem;
    }
    
    /* 移动端小工具悬浮效果 */
    .emoji-mini-item:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    }
    
    .sticker-mini-item:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    }
}

/* 侧边栏宽度设置 */
.sidebar {
    width: 300px;
    margin-left: auto; /* 确保侧边栏靠右显示 */
    margin-right: -5px; /* 调整右侧边距，与导航栏对齐 */
}

/* 移动端侧边栏宽度 */
@media (max-width: 1100px) {
    .sidebar {
        width: 100%;
        margin-left: 0; /* 移动端取消右侧对齐 */
    }
}