/* ==========================================
   Emoji Hub - 样式表
   ========================================== */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    padding-bottom: 3rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================
   顶部导航栏
   ========================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 80px;
}

/* Logo 区域 */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: max-content;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
    transition: transform 0.2s;
}

.logo-icon:hover {
    transform: scale(1.05);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.logo span {
    color: #4f46e5;
}

/* 搜索框 */
.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 1rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    background: white;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-box input::placeholder {
    color: #94a3b8;
}

/* 操作提示 */
.hint {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hint kbd {
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    font-size: 0.75rem;
}

/* ==========================================
   主内容区域
   ========================================== */
.main-content {
    padding: 2rem 0;
}

/* 标签页导航 */
.tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    height: 6px;
}

.tabs::-webkit-scrollbar-track {
    background: transparent;
}

.tabs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.tabs::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.tab-btn {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 9999px;
    background: none;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.tab-btn.active {
    background: #4f46e5;
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.tab-btn.active:hover {
    background: #4338ca;
}

.divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 0.5rem;
}

/* 分类标题 */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.category-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.category-header p {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ==========================================
   表情网格
   ========================================== */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
}

.emoji-card {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    user-select: none;
}

.emoji-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(79, 70, 229, 0.3);
    background: #fefefe;
}

.emoji-card:active {
    transform: translateY(-2px) scale(0.95);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   无结果提示
   ========================================== */
.no-results {
    text-align: center;
    padding: 5rem 1rem;
}

.no-results.hidden {
    display: none;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #64748b;
    font-size: 0.875rem;
}

/* ==========================================
   Toast 提示
   ========================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(5rem);
    padding: 0.75rem 1.5rem;
    background: #1e293b;
    color: white;
    border-radius: 9999px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

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

.toast span:first-child {
    font-size: 1.25rem;
    line-height: 1;
}

/* ==========================================
   响应式设计
   ========================================== */

/* 平板设备 */
@media (min-width: 640px) {
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 1rem;
    }
}

/* 桌面设备 */
@media (min-width: 768px) {
    .hint {
        display: flex;
    }

    .emoji-card {
        font-size: 2.5rem;
    }

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

@media (min-width: 1024px) {
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

/* 手机设备 */
@media (max-width: 640px) {
    .logo h1 {
        display: none;
    }

    .search-box {
        max-width: none;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tabs {
        gap: 0.25rem;
    }

    .tab-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* 超小屏幕 */
@media (max-width: 380px) {
    .header .container {
        height: 70px;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .search-box input {
        font-size: 0.8125rem;
    }

    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 0.5rem;
    }

    .emoji-card {
        font-size: 1.5rem;
    }
}

/* ==========================================
   辅助类
   ========================================== */
.hidden {
    display: none !important;
}

/* 滚动条美化 (全局) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 打印样式 */
@media print {
    .header,
    .tabs,
    .toast {
        display: none;
    }

    .emoji-card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}