@import url("./main.css");
@import url("./common.css");
@import "search_mobile.css";

.searchPage {
    width: 100%;
    min-height: 100vh;
    background-color: #f5f3ff;
    display: flex;
    flex-direction: column;
}

/* 搜索区域样式 */
.search-container {
    max-width: 1200px;
    padding: 2rem 1rem;
    flex: 1;
}

/* 搜索输入框区域 */
.search-input-wrapper {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-input-box {
    display: flex;
    gap: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-input-box:focus-within {
    border-color: #6b46c1;
    background: white;
}

.search-input-box input {
    flex: 1;
    font-size: 1.2rem;
    background: transparent;
}

.search-input-box input::placeholder {
    color: #a0aec0;
}

.search-input-box .search-btn {
    width: 28px;
    height: 28px;
    color: #6b46c1;
    transition: transform 0.3s ease;
}

.search-input-box .search-btn:hover {
    transform: scale(1.1);
}

/* 搜索结果区域 */
.search-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* 游戏卡片样式 */
.game-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.2);
}

.game-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.game-card-content {
    padding: 1rem;
}

.game-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2d3748;
    transition: color 0.3s ease;
}

.game-card:hover h3 {
    color: #6b46c1;
}

.game-card p {
    font-size: 0.9rem;
    color: #718096;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 加载状态和错误提示 */
.loading,
.error,
.no-results {
    grid-column: 1 / -1;
    padding: 3rem;
    text-align: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.loading {
    color: #6b46c1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid #6b46c1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    color: #e53e3e;
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
}

.no-results {
    color: #718096;
    background-color: #f7fafc;
    border: 1px dashed #e2e8f0;
}
