@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    .transition-height {
        transition: max-height 0.3s ease-in-out;
    }
    .form-input-focus {
        @apply border-primary ring-1 ring-primary;
    }
    .card-hover {
        @apply transition-all duration-300 hover:shadow-hover hover:-translate-y-1;
    }
    .btn-primary {
        @apply bg-primary text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 hover:bg-primary/90 focus:ring-2 focus:ring-primary/50 active:scale-95;
    }
    .btn-secondary {
        @apply bg-white text-neutral-700 border border-neutral-200 px-4 py-2 rounded-lg font-medium transition-all duration-200 hover:bg-neutral-50 focus:ring-2 focus:ring-neutral-200 active:scale-95;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F2F3F5;
    margin: 0;
    padding-top: 80px;
}

.header {
    background-color: white;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    transition: all 0.3s ease;
}

.header h1 {
    color: #1F2937;
    display: flex;
    align-items: center;
}

.header h1 i {
    margin-right: 0.5rem;
    color: #165DFF;
}

/* 小屏幕时缩小左右间距 */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0.5rem;
    }
}

.user-info {
    display: flex;
    align-items: center;
    position: relative;
}

.logout-button,
.login-button {
    margin-left: 1rem;
    background-color: #165DFF;
    font-size: 16px; 
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.logout-button i,
.login-button i {
    margin-right: 0.3rem;
}

.logout-button:hover,
.login-button:hover {
    background-color: #0E45B8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    min-width: 320px;
    z-index: 101;
    margin-top: 10px;
    transform-origin: top right;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.2s ease;
}

.user-menu.show {
    display: block;
    transform: scale(1);
    opacity: 1;
}

.user-menu-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
}

.user-menu-title i {
    margin-right: 0.5rem;
    color: #165DFF;
}

.user-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.user-menu-item:hover {
    background-color: #F9FAFB;
    transform: translateX(2px);
}

.info-label {
    color: #6B7280;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.info-label::after {
    content: "：";
}

.info-value {
    color: #1F2937;
    margin-left: 0.25rem;
    display: inline-block;
    max-width: calc(100% - 2rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-container {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

.user-menu-item.logout {
    background-color: #F9FAFB;
    border-radius: 0.375rem;
    margin-top: 1.25rem;
    padding: 0;
    display: flex;
}

.user-menu-item.logout button {
    width: 100%;
    text-align: center;
    font-weight: 500;
    padding: 0.75rem 0;
    border-radius: 0.375rem;
    margin: 0;
    color: #F53F3F;
    display: flex;
    justify-content: center;
    align-items: center;
}

.user-menu-item.logout button i {
    margin-right: 0.3rem;
}

.user-name {
    text-decoration: none;
    cursor: pointer;
    color: #1F2937;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.user-name:hover {
    color: #165DFF;
}

.menu-icon {
    margin-left: 0.5rem;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.2s ease;
}

.menu-icon:hover {
    color: #165DFF;
}

/* 修正后的关闭图标样式 */
.menu-close-icon {
    position: absolute;
    bottom: -22.5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    z-index: 103;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    margin-top: 0;
}

.menu-close-icon i {
    color: #6B7280;
    font-size: 24px;
}

.menu-close-icon:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.menu-close-icon:hover i {
    color: #1F2937;
}

.user-menu.show .menu-close-icon {
    opacity: 1;
    pointer-events: auto;
}

/* 游戏卡片样式 */
.game-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid rgba(203, 213, 225, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #165DFF, #36CFC9);
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 排名项悬停效果 */
.ranking-item {
    transition: all 0.2s ease;
}

.ranking-item:hover {
    background-color: #f8fafc;
    transform: translateX(3px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .game-card {
        padding: 1.5rem;
    }
    
    .level-badge {
        width: 10vw;
        height: 10vw;
        min-width: 40px;
        min-height: 40px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-up {
    animation: slideUp 0.3s ease-in-out;
}

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

        /* 防止轮播图选择和拖拽 */
.slider-images img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* 解锁提示样式 */
.unlock-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(107, 114, 128, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unlock-hint.visible {
    opacity: 1;
}

/* 灰度效果 */
.grayscale {
    filter: grayscale(100%);
}           /* 防止轮播图选择和拖拽 */