/* 简单虚拟滚动样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2.8rem;
    color: #333;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 300;
}

.search-box {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#searchInput {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.search-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
    padding: 0 5px;
}

.search-stats span {
    display: inline-block;
    padding: 5px 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.search-stats span span {
    font-weight: bold;
    color: #667eea;
    background: none;
    padding: 0;
}

/* 虚拟滚动容器 */
.virtual-container {
    height: 70vh;
    min-height: 500px;
    background: white;
    border-radius: 15px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    -webkit-overflow-scrolling: touch; /* 移动端顺滑滚动 */
}

.virtual-container::-webkit-scrollbar {
    width: 8px;
}

.virtual-container::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.virtual-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.virtual-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.scroll-content {
    position: relative;
    width: 100%;
}

/* 游戏项样式 */
.game-item {
    position: absolute;
    width: 100%;
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    background: white;
}

.game-item:hover {
    background: #f9f9ff;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.1);
}

.game-header {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
}

.game-id {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: white;
    background: #667eea;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
}

.game-link {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    word-break: break-all;
}

.game-link:hover {
    color: #667eea;
    text-decoration: underline;
}

.game-link mark {
    background: #ffeb3b;
    color: #333;
    padding: 2px 0;
    border-radius: 2px;
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.status-item {
    color: #666;
    font-size: 0.95rem;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(118, 75, 162, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* 加载指示器 */
.loading {
    display: none;
    text-align: center;
    padding: 30px;
    color: #667eea;
}

.loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .game-id {
        align-self: flex-start;
    }
    
    .game-link {
        -webkit-line-clamp: 3;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .controls {
        width: 100%;
        justify-content: center;
    }
    
    .virtual-container {
        height: 60vh;
    }
}

/* 性能优化 */
.game-item {
    will-change: transform;
    contain: content;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

.empty-state.hidden {
    display: none;
}
