/* 搜尋結果網格系統 - RWD Optimized */
.search-results-grid {
    display: grid;
    /* 強制一行最多 3 個 (大型螢幕下) */
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
    padding: 20px;
    min-height: 200px; /* 防止清空結果時高度瞬間塌陷 (CLS) */
}

.search-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    /* 加大內層距離 */
    background: #1e2024;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 95px;
}

.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-score-color, #555);
    transition: background 0.3s;
}

.search-card:hover {
    transform: translateY(-2px);
    background: rgba(40, 45, 55, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border-color: var(--card-score-color, var(--primary));
}

.search-card:hover::before {
    background: var(--card-score-color, var(--primary));
}


.search-card-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: #000;
    flex-shrink: 0;
}

.search-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.search-card-name {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-card-detail {
    font-size: 12px;
    color: #8b949e;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.search-card-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
}

.search-card-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 60px;
    margin-left: auto;
}

.search-card-action .peek-score-result {
    font-size: 20px !important;
    font-weight: 900 !important;
    color: #f1c40f !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
}

.peek-score-result {
    text-align: right;
    animation: fadeIn 0.3s;
}

/* === Responsive Web Design (RWD) 對應 === */

/* 大型平板與筆電 (1100px 以下)：降為雙欄 */
@media (max-width: 1100px) {
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);

    }
}

/* 平板或手機 (1024px 以下)：雙欄 (優化空間利用) */
@media (max-width: 1024px) {
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .search-card {
        padding: 8px;
        gap: 10px;
    }

    .search-card-img {
        width: 38px;
        height: 38px;
    }

    .search-card-name {
        font-size: 14px;
    }

    .search-card-detail {
        font-size: 11px;
        gap: 4px;
    }

    .search-card-action {
        min-width: 80px;
    }
}

/* 手機版 (480px 以下) */
@media (max-width: 480px) {
    .search-results-grid {
        grid-template-columns: 1fr;
        /* 強制單欄，確保資訊完整顯示 */
        gap: 8px;
    }

    .search-card {
        padding: 8px 10px;
        border-radius: 6px;
        min-height: 60px;
    }

    /* 手機版 (480px 以下) */
    .search-card-img {
        width: 42px;
        height: 42px;
    }

    .search-card-info {
        gap: 3px;
    }

    .search-card-name {
        font-size: 16px;
    }

    .search-card-detail {
        font-size: 12px;
    }

    .search-card-action {
        min-width: 80px;
    }
    
    .mobile-hide,
    .power-hide {
        display: none !important;
    }
}