/**
 * Main CSS file for TikTok Emojis website
 * 主样式文件，包含基础样式、变量和全局设置
 */

/* ==========================================================================
   CSS Reset and Base Styles
   CSS 重置和基础样式
   ========================================================================== */

/* CSS Reset - 重置默认样式 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* HTML and Body - HTML 和 Body 基础样式 */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==========================================================================
   CSS Custom Properties (Variables)
   CSS 自定义属性（变量）
   ========================================================================== */

:root {
    /* Essential Colors - 基础颜色 */
    --primary-color: #ff0050;          /* TikTok 品牌红色 */
    --primary-hover: #e6004c;          /* 主色悬停状态 */
    --secondary-color: #00f2ea;        /* TikTok 青色 */
    
    /* Background Colors - 背景颜色 */
    --bg-primary: #ffffff;             /* 主背景色 */
    --bg-secondary: #f8f9fa;           /* 次要背景色 */
    --bg-tertiary: #e9ecef;            /* 第三级背景色 */
    --bg-card: #ffffff;                /* 卡片背景色 */
    
    /* Text Colors - 文本颜色 */
    --text-primary: #212529;           /* 主要文本色 */
    --text-secondary: #6c757d;         /* 次要文本色 */
    --text-muted: #adb5bd;             /* 静音文本色 */
    --text-inverse: #ffffff;           /* 反色文本 */
    
    /* Border Colors - 边框颜色 */
    --border-primary: #dee2e6;         /* 主要边框色 */
    --border-secondary: #e9ecef;       /* 次要边框色 */
    
    /* Shadow Colors - 阴影颜色 */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    
    /* Spacing - 间距 */
    --spacing-xs: 0.25rem;             /* 4px */
    --spacing-sm: 0.5rem;              /* 8px */
    --spacing-md: 1rem;                /* 16px */
    --spacing-lg: 1.5rem;              /* 24px */
    --spacing-xl: 2rem;                /* 32px */
    --spacing-2xl: 3rem;               /* 48px */
    --spacing-3xl: 4rem;               /* 64px */
    
    /* Border Radius - 圆角 */
    --radius-sm: 0.25rem;              /* 4px */
    --radius-md: 0.5rem;               /* 8px */
    --radius-lg: 1rem;                 /* 16px */
    --radius-xl: 1.5rem;               /* 24px */
    --radius-full: 9999px;             /* 完全圆形 */
    
    /* Essential Typography - 基础字体 */
    --font-size-sm: 0.875rem;          /* 14px */
    --font-size-base: 1rem;            /* 16px */
    --font-size-lg: 1.125rem;          /* 18px */
    --font-size-xl: 1.25rem;           /* 20px */
    --font-size-2xl: 1.5rem;           /* 24px */
    --font-size-3xl: 1.875rem;         /* 30px */
    --font-size-4xl: 2.25rem;          /* 36px */
    
    /* Font Weights - 字体粗细 */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Line Heights - 行高 */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Transitions - 过渡动画 */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    
    /* Essential Z-Index Scale - 基础Z轴层级 */
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-toast: 1080;
    
    /* Container Max Widths - 容器最大宽度 */
    --container-sm: 540px;
    --container-md: 720px;
    --container-lg: 960px;
    --container-xl: 1140px;
    --container-xxl: 1320px;
}


/* ==========================================================================
   Base Typography
   基础字体样式
   ========================================================================== */

/* Headings - 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

/* Paragraphs - 段落样式 */
p {
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-relaxed);
    color: var(--text-secondary);
}

/* Links - 链接样式 */
a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--text-link-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Lists - 列表样式 */
ul, ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xl);
}

li {
    margin-bottom: var(--spacing-xs);
    line-height: var(--line-height-relaxed);
}

/* ==========================================================================
   Layout Components
   布局组件
   ========================================================================== */

/* Container - 容器 */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

@media (min-width: 576px) {
    .container {
        max-width: var(--container-sm);
    }
}

@media (min-width: 768px) {
    .container {
        max-width: var(--container-md);
        padding: 0 var(--spacing-2xl);
    }
}

@media (min-width: 992px) {
    .container {
        max-width: var(--container-lg);
        padding: 0 var(--spacing-3xl);
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: var(--container-xl);
        padding: 0 5rem;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: var(--container-xxl);
    }
}

/* Section Spacing - 区块间距 */
section {
    padding: var(--spacing-3xl) 0;
}

section:first-of-type {
    padding-top: var(--spacing-2xl);
}

section:last-of-type {
    padding-bottom: var(--spacing-2xl);
}

/* ==========================================================================
   Essential Focus Management
   基础焦点管理
   ========================================================================== */

/* Focus Styles - 焦点样式 */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen Reader Only - 仅屏幕阅读器可见 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Loading States
   加载状态
   ========================================================================== */

/* Loading Spinner - 加载旋转器 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-secondary);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton Loading - 骨架屏加载 */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

 