* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.subtitle {
    font-size: 1.1rem;
    color: #6c757d;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.category-btn {
    background: white;
    border: 1px solid #e9ecef;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-color: #007bff;
    color: #007bff;
}

.category-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    padding: 0;
}

.emoji-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 70px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 4px;
    gap: 4px;
}

.emoji-item .emoji {
    font-size: 20px;
    line-height: 1;
}

.emoji-item .emoji-name {
    font-size: 10px;
    color: #6c757d;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emoji-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.emoji-item:hover .emoji-name {
    color: #1976d2;
}

.emoji-item:active {
    transform: scale(0.95);
}

/* 分类标题样式 - 在统一网格中显示 */
.category-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 20px 0 16px 0;
    padding: 0 0 12px 0;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    position: relative;
    grid-column: 1 / -1; /* 占据整行 */
}

.category-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #007bff, #6f42c1);
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .category-nav {
        gap: 8px;
    }
    
    .category-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
        padding: 20px;
    }
    
    .emoji-item {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .emoji-item {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
}