:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #ff7675;
    --accent-color-2: #00cec9;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --card-hover-transform: translateY(-8px);
    --neon-glow: 0 0 20px rgba(108, 92, 231, 0.5);
}

.announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 0;
    background: linear-gradient(90deg, rgba(108, 92, 231, 0.9), rgba(162, 155, 254, 0.9), rgba(255, 118, 117, 0.9));
    background-size: 200% 100%;
    z-index: 99999;
    overflow: hidden;
    animation: gradientShift 3s ease infinite;
}

.announcement-content {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
}

.announcement-content span {
    display: inline-block;
    padding: 0 20px;
    white-space: nowrap;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes mentionFlash {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 0 20px rgba(255, 118, 117, 0.8); }
}

@keyframes scrollLeft {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Segoe UI', 'Microsoft YaHei', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-tap-highlight-color: transparent;
    cursor: default;
}

a, button, .game-card, .game-image {
    cursor: pointer;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: #2d3436;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 118, 117, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 206, 201, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -2;
}

.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff7675, #6c5ce7);
    pointer-events: none;
    z-index: 9999;
    animation: fadeOut 0.8s forwards;
    mix-blend-mode: multiply;
}

@keyframes fadeOut {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: floatOrb 20s infinite ease-in-out alternate;
    will-change: transform;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #74b9ff;
    mix-blend-mode: screen;
}

.orb-2 {
    bottom: 0%;
    right: -5%;
    width: 450px;
    height: 450px;
    background: #ff7675;
    animation-delay: -5s;
    mix-blend-mode: screen;
}

.orb-3 {
    top: 30%;
    left: 40%;
    width: 350px;
    height: 350px;
    background: #a29bfe;
    animation-delay: -8s;
    opacity: 0.4;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(30px, 40px) scale(1.05) rotate(10deg);
    }
    100% {
        transform: translate(-20px, 20px) scale(0.95) rotate(-5deg);
    }
}

#snowContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    padding: 40px 15px 30px;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #fff, #a29bfe, #ff7675, #fff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    letter-spacing: -1px;
    filter: drop-shadow(0 4px 15px rgba(108, 92, 231, 0.4));
    animation: fadeInDown 0.8s ease-out, gradientMove 6s ease infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    position: relative;
    display: inline-block;
}

h1::after {
    content: '🐳';
    position: absolute;
    right: -45px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    -webkit-text-fill-color: initial;
}

@keyframes bounce {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(-60%); }
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.tips-container {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 18px 30px;
    margin: 0 auto 35px;
    max-width: 850px;
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12), inset 0 1px 0 rgba(255,255,255,0.5);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    font-size: 1rem;
    color: #2d3436;
    animation: fadeIn 1s ease-out, float 6s ease-in-out infinite;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.tips-container:hover {
    transform: translateY(-5px) scale(1.02);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 50px rgba(108, 92, 231, 0.2);
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 15px;
    background: rgba(108, 92, 231, 0.08);
    transition: all 0.3s;
}

.tip-item:hover {
    background: rgba(108, 92, 231, 0.15);
    transform: scale(1.05);
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-wrapper {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
    z-index: 10;
}

.search-input {
    width: 100%;
    padding: 20px 35px;
    border-radius: 60px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 2px 0 rgba(255,255,255,0.5);
    font-size: 1.15rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 50px rgba(108, 92, 231, 0.2), 0 0 0 4px rgba(108, 92, 231, 0.1);
    transform: translateY(-3px) scale(1.02);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
    animation: fadeIn 1.2s ease-out;
}

.game-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255,255,255,0.3) inset;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 400px;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--accent-color-2));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}

.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: none;
    z-index: 10;
    pointer-events: none;
}

.game-card:hover::after {
    animation: shine 0.8s ease-in-out;
}

.game-card:hover::before {
    opacity: 1;
}

.game-card.skeleton {
    pointer-events: none;
}

.game-card.skeleton .skeleton-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.game-card.skeleton .skeleton-text {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: 10px;
}

.skeleton-meta {
    height: 14px;
    width: 50%;
}

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

.game-image-wrapper {
    position: relative;
    width: 100%;
    height: 195px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.game-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(255,255,255,0.3), transparent);
    pointer-events: none;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.game-card:hover .game-image {
    transform: scale(1.15);
}

.badges-container {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 2;
}

.badge {
    padding: 5px 14px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 0.72rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
}

.badge:hover {
    transform: scale(1.1) rotate(-2deg);
}

.badge-pin {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 4px 15px rgba(253, 203, 110, 0.4); }
    to { box-shadow: 0 4px 25px rgba(253, 203, 110, 0.7); }
}

.badge-featured {
    background: linear-gradient(135deg, #ff7675, #d63031);
}

.badge-new {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.game-info {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
}

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.game-card:hover .game-title {
    color: var(--primary-color);
}

.game-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    color: #636e72;
    font-size: 0.85rem;
    font-weight: 500;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    padding: 2px 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 8px;
}

.stat-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.like-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid transparent;
    cursor: pointer;
    color: #b2bec3;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 12px;
}

.like-btn:hover {
    background: rgba(255, 118, 117, 0.15);
    color: #ff7675;
    border-color: #ff7675;
}

.like-btn.liked {
    color: #ff7675;
    font-weight: bold;
    background: rgba(255, 118, 117, 0.1);
}

.like-btn svg,
.like-btn.liked svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.like-btn.liked svg {
    filter: drop-shadow(0 0 3px #ff7675);
}

.comment-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid transparent;
    cursor: pointer;
    color: #6c5ce7;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 12px;
}

.comment-btn:hover {
    background: rgba(108, 92, 231, 0.15);
    color: #6c5ce7;
    border-color: #6c5ce7;
}

.comment-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

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

.play-btn {
    margin-top: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 14px 0;
    width: 100%;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.35);
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.play-btn:hover::before {
    left: 100%;
}

.play-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.45);
    filter: brightness(1.1);
}

.play-btn:active {
    transform: translateY(1px) scale(0.98);
}

.play-btn:disabled {
    background: linear-gradient(135deg, #b2bec3, #636e72);
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
    filter: grayscale(0.8);
}

.user-panel {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.auth-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 12px 26px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
}

.auth-btn:hover {
    background: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.2);
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.35);
}

.auth-btn.primary:hover {
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.5);
}

.game-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: none;
    flex-direction: column;
}

.game-viewer.active {
    display: flex;
}

.game-frame {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-frame.mobile-mode {
    width: 430px;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: 0 0 0 100vw #000;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
}

.game-frame.force-landscape {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vh !important;
    height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg);
    z-index: 9990;
    max-width: none !important;
    border: none !important;
    box-shadow: none !important;
}

.wrench-btn {
    position: fixed;
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: grab;
    z-index: 10001;
    transition: transform 0.2s, box-shadow 0.2s;
    top: 30px;
    left: 30px;
    user-select: none;
    -webkit-user-select: none;
    font-size: 1.5rem;
}

.wrench-btn:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.wrench-btn:hover {
    transform: scale(1.1) rotate(15deg);
}

.tool-menu {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 8px;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    z-index: 10002;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-menu.active {
    display: flex;
}

.tool-item {
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: #2d3436;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-item:hover {
    background: #f1f2f6;
    color: var(--primary-color);
    transform: translateX(3px);
}

.tool-item.danger {
    color: #d63031;
}

.tool-item.danger:hover {
    background: #ffeaa7;
    color: #d63031;
}

#icpFilingDisplay a:hover {
    opacity: 1 !important;
    text-decoration: underline !important;
    cursor: pointer;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal.active .modal-box {
    transform: scale(1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-xs: 8px;
        --spacing-sm: 12px;
        --spacing-md: 15px;
        --spacing-lg: 20px;
    }
    h1 {
        font-size: 1.8rem;
    }
    h1::after {
        display: none;
    }
    .announcement-bar {
        padding: 8px 0;
    }
    .announcement-content span {
        font-size: 0.85rem;
        padding: 0 15px;
    }
    header {
        padding: 15px 0 10px;
    }
    header .container {
        flex-direction: column;
        gap: 10px;
    }
    .search-bar {
        width: 100%;
        max-width: 100%;
        order: 2;
    }
    .search-input {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px 15px 10px 35px;
    }
    .user-panel {
        position: static;
        justify-content: center;
        order: 1;
    }
    .category-scroll {
        padding: 0 10px;
    }
    .category-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    .tips-container {
        padding: var(--spacing-sm);
        gap: 8px;
        margin-bottom: 15px;
    }
    .tip-item {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    .container {
        padding: var(--spacing-sm);
    }
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 8px 0;
    }
    .game-card {
        height: auto;
        border-radius: 12px;
    }
    .game-image-wrapper {
        height: auto;
        aspect-ratio: 16/9;
    }
    .game-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .game-carousel {
        height: auto;
        aspect-ratio: 16/9;
    }
    .game-carousel-slide img {
        object-fit: cover;
    }
    .game-info {
        padding: 8px 10px;
    }
    .game-title {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    .game-meta-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
    }
    .meta-stats {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .stat-item {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    .stat-item .stat-icon {
        font-size: 0.7rem;
    }
    .like-btn {
        font-size: 0.7rem;
        padding: 2px 6px;
        border-radius: 8px;
    }
    .comment-btn {
        position: static;
        width: auto;
        height: auto;
        border-radius: 8px;
        padding: 2px 6px;
        background: rgba(255, 255, 255, 0.5);
        font-size: 0.7rem;
    }
    .comment-count {
        font-size: 0.7rem;
    }
    .play-btn {
        padding: 8px 0;
        font-size: 0.8rem;
        margin-top: 8px;
        border-radius: 10px;
    }
    .user-panel {
        top: 8px;
        right: 8px;
        gap: 6px;
    }
    .auth-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        border-radius: 20px;
    }
    .user-info-panel span:first-child {
        display: none;
    }
    .wrench-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        top: 12px;
        left: 12px;
    }
    .badges-container {
        top: 8px;
        right: 8px;
        gap: 6px;
    }
    
    /* 平板端聊天窗口恢复PC样式 */
    .chat-widget {
        right: 20px;
        bottom: 20px;
    }
    .chat-container {
        position: fixed !important;
        top: 45px !important;
        left: auto !important;
        right: 20px !important;
        bottom: 20px !important;
        transform: translateY(20px) scale(0.95) !important;
        width: 380px !important;
        max-width: calc(100vw - 40px) !important;
        height: auto !important;
        max-height: calc(100vh - 120px) !important;
        border-radius: 20px !important;
    }
    .chat-container.active {
        transform: translateY(0) scale(1) !important;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 1.8rem;
    }
    .chat-widget {
        right: 10px;
        bottom: 10px;
    }
    .chat-toggle-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .chat-container {
        position: fixed !important;
        top: 45px !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 85% !important;
        max-width: 320px !important;
        height: auto !important;
        max-height: calc(100vh - 45px) !important;
        border-radius: 15px 0 0 15px;
        transform: translateX(100%) !important;
        transition: transform 0.3s ease-in-out !important;
    }
    .chat-container.active {
        transform: translateX(0) !important;
    }
}

.chat-widget {
    position: fixed;
    z-index: 9998;
    right: 20px;
    bottom: 20px;
    font-family: 'PingFang SC', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(108, 92, 231, 0.5);
}

.chat-toggle-btn .chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff7675;
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: bold;
    display: none;
}

.chat-toggle-btn.has-new .chat-badge {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-container {
    position: fixed;
    top: 45px;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    height: auto;
    max-height: calc(100vh - 45px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9998;
}

.chat-container.active {
    transform: translateX(0);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-online-count {
    font-size: 0.8rem;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 15px;
}

.chat-announcement {
    padding: 8px 12px;
    background: linear-gradient(90deg, rgba(108, 92, 231, 0.9), rgba(162, 155, 254, 0.9));
    color: white;
    font-size: 0.85rem;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    animation: gradientShift 3s ease infinite;
    background-size: 200% 100%;
}

.chat-announcement span {
    display: inline-block;
    animation: chatAnnounceScroll linear infinite;
}

@keyframes chatAnnounceScroll {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.chat-close-btn:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
    min-height: 0;
}

.chat-online-users {
    padding: 8px 15px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(162, 155, 254, 0.1));
    border-bottom: 1px solid #dfe6e9;
    font-size: 0.8rem;
    color: #636e72;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-online-users-label {
    font-weight: 600;
    color: #6c5ce7;
}

.chat-online-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(108, 92, 231, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin: 2px;
    color: #2d3436;
    font-size: 0.75rem;
}

.chat-online-user .avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6c5ce7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(108, 92, 231, 0.3);
    border-radius: 3px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

.chat-message.self {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.other {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-message.guest .chat-bubble {
    background: #f5f6fa;
    border: 1px solid #e9ecef;
}

.chat-username {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 3px;
    padding: 0 5px;
}

.chat-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.chat-message.self .chat-bubble {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.other .chat-bubble {
    background: white;
    color: #2d3436;
    border: 1px solid #dfe6e9;
    border-bottom-left-radius: 4px;
}

.chat-time {
    font-size: 0.65rem;
    color: #b2bec3;
    margin-top: 3px;
    padding: 0 5px;
}

.chat-input-area {
    padding: 10px 12px;
    background: white;
    border-top: 1px solid #dfe6e9;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chat-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #dfe6e9;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #6c5ce7;
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.chat-send-btn:disabled {
    background: #dfe6e9;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-empty {
    text-align: center;
    color: #b2bec3;
    padding: 40px 20px;
    font-size: 0.9rem;
}

.chat-system-msg {
    text-align: center;
    font-size: 0.75rem;
    color: #b2bec3;
    padding: 5px 0;
}

.chat-emoji-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chat-emoji-btn:hover {
    opacity: 1;
    background: #f0f0f0;
}

.chat-color-picker {
    display: none;
    gap: 8px;
    padding: 10px 15px;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #e9ecef;
    align-items: center;
    flex-wrap: wrap;
}

.chat-color-picker.show {
    display: flex;
}

.chat-color-picker-label {
    font-size: 0.7rem;
    color: #636e72;
    margin-right: 5px;
    white-space: nowrap;
}

.chat-color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #fff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.chat-color-btn:hover {
    transform: scale(1.2) rotate(10deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.chat-color-btn.active {
    border-color: #2d3436;
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.chat-color-btn.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.chat-emoji-picker {
    position: absolute;
    bottom: 55px;
    left: -10px;
    width: 220px;
    height: 150px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    border: 1px solid #dfe6e9;
}

.chat-emoji-picker.active {
    display: flex;
    animation: popIn 0.2s ease;
}

.chat-emoji-picker-header {
    padding: 6px 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #dfe6e9;
    font-size: 0.75rem;
    font-weight: 600;
    color: #636e72;
}

.chat-emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    padding: 6px;
    overflow-y: auto;
    flex: 1;
}
    gap: 2px;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.chat-emoji-item {
    font-size: 1.4rem;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}

.chat-emoji-item:hover {
    background: #f1f2f6;
    transform: scale(1.2);
}

.chat-mention-popup {
    position: absolute;
    bottom: 60px;
    left: 10px;
    width: 220px;
    max-height: 180px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    border: 1px solid #dfe6e9;
}

.chat-mention-popup.active {
    display: flex;
    animation: popIn 0.15s ease;
}

.chat-mention-header {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dfe6e9;
    font-size: 0.75rem;
    font-weight: 600;
    color: #636e72;
}

.chat-mention-list {
    overflow-y: auto;
    flex: 1;
}

.chat-mention-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.chat-mention-item:hover,
.chat-mention-item.selected {
    background: #f1f2f6;
}

.chat-mention-item .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
}

.chat-mention-item .name {
    font-size: 0.85rem;
    color: #2d3436;
}

.chat-at-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chat-at-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: #f0f0f0;
}

.chat-message.mentioned {
    background: rgba(255, 118, 117, 0.1);
    border-radius: 8px;
    padding: 4px;
    margin: 2px 0;
    border-left: 3px solid #ff7675;
}

.chat-bubble .mention-highlight {
    background: rgba(108, 92, 231, 0.15);
    color: #6c5ce7;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* 分类筛选 */
.category-filter {
    padding: 10px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.category-btn.active {
    background: #fff;
    color: #6c5ce7;
    border-color: #fff;
}

.badge-category {
    background: #00cec9;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 5px;
}

/* 游戏评分 */
.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    opacity: 0.8;
}

.stat-item .stat-icon {
    font-size: 1rem;
}

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

/* 深色主题 */
body.dark-theme {
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --glass-bg: rgba(30, 30, 50, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    background: var(--bg-gradient);
    color: #e0e0e0;
}

body.dark-theme .game-card {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

body.dark-theme .game-title {
    color: #f5f5f5;
}

body.dark-theme .game-meta,
body.dark-theme .stat-item {
    color: #b0b0b0;
}

body.dark-theme .chat-online-user {
    color: #d0d0d0;
}

body.dark-theme .search-input,
body.dark-theme .modal-box,
body.dark-theme .user-panel,
body.dark-theme .chat-container {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: #e0e0e0;
}

body.dark-theme input {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

body.dark-theme .chat-input {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

body.dark-theme .chat-input-area {
    background: rgba(30, 30, 50, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* 搜索历史 */
.search-history {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    border-radius: 10px;
    margin-top: 5px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.search-history-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-history-item:hover {
    background: rgba(108, 92, 231, 0.1);
}

.search-history-item .clear-btn {
    background: none;
    border: none;
    color: #ff7675;
    cursor: pointer;
    font-size: 0.8rem;
}

/* 图片画廊模态框 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.image-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

.image-modal-prev, .image-modal-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 10001;
}

.image-modal-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.image-modal-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.image-modal-prev:hover, .image-modal-next:hover {
    background-color: rgba(108, 92, 231, 0.8);
}

.game-image {
    cursor: pointer;
}

/* 游戏卡片轮播 */
.game-carousel {
    position: relative;
    width: 100%;
    height: 195px;
    overflow: hidden;
    touch-action: pan-y;
}

.game-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    touch-action: none;
}

.game-carousel-slide.active {
    opacity: 1;
}

.game-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.game-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}

.game-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s;
}

.game-carousel-dot.active {
    background: white;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.game-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    font-size: 14px;
    transition: all 0.3s;
    z-index: 3;
    opacity: 0;
}

.game-carousel:hover .game-carousel-arrow {
    opacity: 1;
}

.game-carousel-arrow:hover {
    background: rgba(108, 92, 231, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.game-carousel-arrow.prev {
    left: 10px;
}

.game-carousel-arrow.next {
    right: 10px;
}

.game-card:hover .game-carousel-slide img {
    transform: scale(1.15);
}

.game-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#userAvatar {
    transition: transform 0.3s;
}

#userAvatar:hover {
    transform: scale(1.1);
}

#userAvatarBtn {
    transition: transform 0.3s;
}

#userAvatarBtn:hover {
    transform: scale(1.1);
}

#headerAvatarInitial {
    font-weight: 600;
}
