* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #f7f9fc;
    font-family: 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
    color: #1e2a3e;
    line-height: 1.5;
    padding: 2rem 1.5rem;
}

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 2rem;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: all 0.2s ease;
}

/* 头部区域 */
.header {
    padding: 1.8rem 2rem 1.2rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #fef9e8 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

/* 返回首页按钮 */
.back-home-btn {
    position: absolute;
    top: 1.2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(243, 156, 18, 0.1);
    color: #e67e22;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(243, 156, 18, 0.2);
}

.back-home-btn:hover {
    background: rgba(243, 156, 18, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2);
}

.back-icon {
    font-size: 1.1rem;
}

h1 {
    font-size: 1.9rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b3b5c, #e67e22);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

h1:before {
    content: "😊";
    font-size: 2rem;
    background: none;
    -webkit-background-clip: unset;
    color: #e67e22;
}

.sub {
    color: #5b6e8c;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    border-left: 3px solid #f39c12;
    padding-left: 0.75rem;
}

/* 搜索栏 */
.search-section {
    margin-top: 1.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 60px;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 1rem;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.search-box:focus-within {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
}

.search-icon {
    color: #94a3b8;
    font-size: 1.2rem;
    margin-right: 0.5rem;
    font-weight: 400;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0.7rem 0;
    font-size: 1rem;
    background: transparent;
    outline: none;
    color: #1e2a3e;
}

.search-box input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.clear-search {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 0.25rem;
    transition: color 0.2s;
}

.clear-search:hover {
    color: #e67e22;
}

/* 分类标签栏 */
.categories {
    padding: 1rem 2rem 0.2rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    border-bottom: 1px solid #edf2f7;
    background: #ffffff;
}

.cat-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5b7a;
    font-family: inherit;
    background: #f1f5f9;
}

.cat-btn i {
    margin-right: 6px;
    font-style: normal;
}

.cat-btn.active {
    background: #f39c12;
    color: white;
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.2);
}

.cat-btn:hover:not(.active) {
    background: #e9ecef;
    color: #e67e22;
    transform: translateY(-1px);
}

/* 统计 & 工具栏 */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: #fafcfd;
    font-size: 0.85rem;
    color: #5b6e8c;
    border-bottom: 1px solid #ecf3f8;
}

.result-count {
    font-weight: 500;
}

.copy-tip {
    background: #eef2ff;
    padding: 0.2rem 0.7rem;
    border-radius: 30px;
    font-size: 0.75rem;
}

/* 表情网格 */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
    padding: 2rem;
    background: #ffffff;
    transition: 0.1s;
}

.emoji-card {
    background: #ffffff;
    border-radius: 1.2rem;
    padding: 1rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border: 1px solid #edf2f7;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.emoji-card:hover {
    transform: translateY(-5px);
    border-color: #fde2c4;
    box-shadow: 0 18px 25px -12px rgba(0, 0, 0, 0.12);
    background: #fffbf5;
}

.emoji-display {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.emoji-name {
    font-size: 0.75rem;
    color: #4b556b;
    font-weight: 500;
    word-break: break-word;
    background: #f8fafc;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    max-width: 95%;
    white-space: nowrap;
    overflow-x: hidden;
    text-overflow: ellipsis;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Toast 提示 */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: #1e293b;
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    backdrop-filter: blur(8px);
    background: rgba(0,0,0,0.8);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 1.2rem;
    font-size: 0.75rem;
    color: #8ca3b9;
    border-top: 1px solid #ecf3f8;
    background: #fefefe;
}

/* 响应式 */
@media (max-width: 680px) {
    body {
        padding: 1rem;
    }
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.8rem;
        padding: 1.2rem;
    }
    .emoji-display {
        font-size: 2.3rem;
    }
    .emoji-name {
        font-size: 0.65rem;
        white-space: normal;
        word-break: keep-all;
    }
    .cat-btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
    .header {
        padding: 1.2rem 1.2rem 0.8rem;
    }
    .categories {
        padding: 0.8rem 1.2rem;
    }
    .stats-bar {
        padding: 0.6rem 1.2rem;
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }
    /* 移动端返回首页按钮调整 */
    .back-home-btn {
        top: 0.8rem;
        right: 1.2rem;
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    .back-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .emoji-name {
        font-size: 0.6rem;
    }
}
