* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'SimHei', sans-serif;
    background: linear-gradient(180deg, 
        #5B9AE0 0%,
        #6BA8E8 20%,
        #7BB6F0 40%,
        #8BC4F8 60%,
        #9BD2FF 80%,
        #ABE0FF 100%
    );
    background-attachment: fixed;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

body::before {
    content: '❄';
    position: fixed;
    top: 0;
    left: 20%;
    font-size: 2.5em;
    color: rgba(255, 255, 255, 0.7);
    animation: snowfall-1 10s linear infinite;
    pointer-events: none;
    z-index: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

body::after {
    content: '❅';
    position: fixed;
    top: 0;
    right: 20%;
    font-size: 2em;
    color: rgba(255, 255, 255, 0.65);
    animation: snowfall-2 12s linear infinite 2s;
    pointer-events: none;
    z-index: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

@keyframes snowfall-1 {
    0% { transform: translate(0, -100px); opacity: 0; }
    10% { opacity: 1; }
    25% { transform: translate(20px, 25vh); }
    50% { transform: translate(40px, 50vh); }
    75% { transform: translate(20px, 75vh); }
    90% { opacity: 1; }
    100% { transform: translate(0, 100vh); opacity: 0; }
}

@keyframes snowfall-2 {
    0% { transform: translate(0, -100px); opacity: 0; }
    10% { opacity: 1; }
    25% { transform: translate(-15px, 25vh); }
    50% { transform: translate(-30px, 50vh); }
    75% { transform: translate(-15px, 75vh); }
    90% { opacity: 1; }
    100% { transform: translate(0, 100vh); opacity: 0; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes expandGrid {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes copyPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        background: #4ade80;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease;
}

h1 {
    color: #FFF4A3;
    font-size: 3.2em;
    margin-bottom: 15px;
    font-weight: 900;
    text-shadow: 
        3px 0 0 #FFB347,
        -3px 0 0 #FFB347,
        0 3px 0 #FFB347,
        0 -3px 0 #FFB347,
        3px 3px 0 #FF8C42,
        6px 6px 0 #3A7BC8,
        8px 8px 0 rgba(0,0,0,0.3);
    letter-spacing: 4px;
    filter: contrast(1.1);
}

.stats-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    animation: fadeIn 1s ease;
}

.stat-item {
    background: #A8C8F0;
    color: white;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    border: 4px solid #FFFFFF;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    transition: transform 0.15s ease;
}

.stat-item:hover {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.main-content {
    background: #E8F4FF;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: fadeIn 1.2s ease;
    border: 5px solid #FFFFFF;
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    width: 12px;
    height: 12px;
    background: #FFD93D;
    border: 3px solid #FFF;
    box-shadow: 
        30px 0 0 #FF6B9D,
        30px 0 0 0 3px #FFF,
        60px 0 0 #6BCFFF,
        60px 0 0 0 3px #FFF;
}

.main-content::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 8px;
    right: -8px;
    height: 8px;
    background: #5B9AD8;
    border-radius: 0 0 12px 12px;
    z-index: -1;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.category {
    animation: slideIn 0.6s ease;
}

.category-header {
    background: #C8D8FF;
    color: white;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1em;
    border: 4px solid #FFFFFF;
    margin-bottom: 0;
    width: 100%;
    white-space: nowrap;
    min-height: 48px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    position: relative;
    will-change: transform;
}

.category-header:hover {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    background: #B8C8F8;
}

.category-header:active {
    transform: translateY(2px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.category-header.active {
    background: #FFB347;
    box-shadow: 0 3px 8px rgba(255,107,61,0.4);
    border-color: #FFF;
}

.category-icon {
    font-size: 1.1em;
}

.category-title {
    font-size: 0.95em;
}

.emoji-content {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 12px;
    padding: 25px;
    background: #FFFFFF;
    border-radius: 12px;
    margin-top: 20px;
    animation: expandGrid 0.4s ease;
    border: 4px solid #B8D8FF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transform: translateZ(0);
    contain: layout style;
    overscroll-behavior: contain;
}

.emoji-content.active {
    display: grid;
}

.emoji-item {
    font-size: 2em;
    padding: 12px 10px 10px 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    background: #F0F8FF;
    border: 3px solid #D0E0F8;
    position: relative;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
    will-change: transform;
    contain: layout style paint;
}

.emoji-item:hover {
    transform: translateY(-2px);
    background: #FFE66D;
    border-color: #FFD93D;
    box-shadow: 0 4px 8px rgba(255,200,61,0.3);
    z-index: 10;
}

.emoji-item:hover .emoji-label {
    color: #FF8C42;
    font-weight: 700;
}

.emoji-item:active {
    transform: translateY(0px);
    box-shadow: 0 1px 3px rgba(255,200,61,0.25);
}

.emoji-item.copied {
    animation: copyPulse 0.6s ease;
}

.emoji-char {
    font-size: 1em;
}

.emoji-label {
    font-size: 0.28em;
    color: #666;
    line-height: 1.3;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
    padding: 0 1px;
    text-align: center;
}

.emoji-variant-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 26px 26px;
    border-color: transparent transparent rgba(128, 128, 128, 0.75) transparent;
    pointer-events: none;
    border-radius: 0 0 10px 0;
    overflow: visible;
}

.emoji-variant-badge::after {
    content: '变体';
    position: absolute;
    bottom: -20px;
    right: -1px;
    font-size: 9px;
    color: white;
    font-weight: 600;
    transform: rotate(-45deg);
    transform-origin: center center;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    line-height: 1;
}

.variant-popup {
    position: fixed;
    background: #E8F4FF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    padding: 15px 18px;
    display: none;
    z-index: 9999;
    animation: popupFadeIn 0.2s ease;
    border: 5px solid #FFFFFF;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.variant-popup.show {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-item {
    font-size: 2em;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.15s ease, background 0.15s ease;
    background: #FFFFFF;
    min-width: 55px;
    flex-shrink: 0;
    border: 3px solid #D0E8FF;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    will-change: transform;
    contain: layout style paint;
}

.variant-item:hover {
    background: #FFE66D;
    border-color: #FFD93D;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255,200,61,0.3);
}

.variant-item:active {
    transform: translateY(0px);
    box-shadow: 0 1px 3px rgba(255,200,61,0.25);
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #6BCF7C;
    color: white;
    padding: 16px 28px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-weight: 700;
    font-size: 1.2em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 10000;
    border: 4px solid #FFFFFF;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1200px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .emoji-content {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
        padding: 15px;
    }

    .emoji-item {
        font-size: 1.4em;
        padding: 8px 4px 6px 4px;
    }

    .emoji-label {
        font-size: 0.28em;
    }

    .emoji-variant-badge {
        border-width: 0 0 22px 22px;
    }

    .emoji-variant-badge::after {
        font-size: 8px;
        bottom: -17px;
        right: -1px;
    }

    .main-content {
        padding: 20px;
    }

    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}


