:root {
    --sg-bg: #ffffff;
    --sg-border: rgba(0, 0, 0, 0.08);
    --sg-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --sg-text-main: #1f2937;
    --sg-text-sub: #6b7280;
    --sg-radius: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --sg-bg: #1e2023;
        --sg-border: rgba(255, 255, 255, 0.1);
        --sg-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        --sg-text-main: #f3f4f6;
        --sg-text-sub: #9ca3af;
    }
}

/* --- 卡片通用容器 --- */
.sg-card {
    display: flex;
    position: relative;
    overflow: hidden;
    margin: 30px 0;
    border-radius: var(--sg-radius);
    background: var(--sg-bg);
    border: 1px solid var(--sg-border);
    box-shadow: var(--sg-shadow);
    text-decoration: none !important;
    color: var(--sg-text-main) !important;
    transition: all 0.3s ease;
    height: 160px;
}

.sg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    border-color: rgba(0,0,0,0.15);
}

.sg-card-error {
    padding: 15px;
    border: 1px dashed #ef4444;
    color: #ef4444;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.05);
}

/* --- 背景水印图标 --- */
.sg-bg-icon {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: contain;
}

/* GitHub Icon (Octocat) */
.sg-bg-github {
    right: -20px;
    bottom: -30px;
    width: 150px;
    height: 150px;
    opacity: 0.05;
    transform: rotate(-15deg);
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzI0MjkyZSI+PHBhdGggZD0iTTEyIC4yOTdjLTYuNjMgMC0xMiA1LjM3My0xMiAxMiAwIDUuMzAzIDMuNDM4IDkuOCA4LjIwNSAxMS4zODUuNi4xMTMuODItLjI1OC44Mi0uNTc3IDAtLjI4NS0uMDEtMS4wNC0uMDE1LTIuMDQtMy4zMzguNzI0LTQuMDQyLTEuNjEtNC4wNDItMS42MUM0LjQyMiAxOC4wNyAzLjYzMyAxNy43IDMuNjMzIDE3LjdjLTEuMDg3LS43NDQuMDg0LS43MjkuMDg0LS43MjkgMS4yMDUuMDg0IDEuODM4IDEuMjM2IDEuODM4IDEuMjM2IDEuMDcgMS44MzUgMi44MDkgMS4zMDUgMy40OTUuOTk4LjEwOC0uNzc2LjQxOS0xLjMwNS43Ni0xLjYwNS0yLjY2NS0uMy01LjQ2Ni0xLjMzMi01LjQ2Ni01LjkzIDAtMS4zMS40NjUtMi4zOCAxLjIzNS0zLjIyLS4xMzUtLjMwMy0uNTQtMS41MjMuMTA1LTMuMTc2IDAgMCAxLjAwNS0uMzIyIDMuMyAxLjIzLjk2LS4yNjcgMS45OC0uMzk5IDMtLjQwNSAxLjAyLjAwNiAyLjA0LjEzOCAzIC40MDUgMi4yOC0xLjU1MiAzLjI4NS0xLjIzIDMuMjg1LTEuMjMuNjQ1IDEuNjUzLjI0IDIuODczLjEyIDMuMTc2Ljc2NS44NCAxLjIzIDEuOTEgMS4yMyAzLjIyIDAgNC42MS0yLjgwNSA1LjYyNS01LjQ3NSA1LjkyLjQyLjM2LjgxIDEuMDk2LjgxIDIuMjIgMCAxLjYwNi0uMDE1IDIuODk2LS4wMTUgMy4yODYgMCAuMzE1LjIxLjY5LjgyNS41N0MyMC41NjUgMjIuMDkyIDI0IDE3LjU5MiAyNCAxMi4yOTdjMC02LjYyNy01LjM3My0xMi0xMi0xMiIvPjwvc3ZnPg==');
}

/* Steam Icon (换回了经典的大圆圈图标，辨识度最高) */
.sg-bg-steam {
    right: -30px;
    bottom: -30px;
    width: 180px; 
    height: 180px;
    opacity: 0.08;
    transform: rotate(15deg);
    /* FontAwesome Standard Steam Icon */
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OTYgNTEyIiBmaWxsPSIjMTcxYTIxIj48cGF0aCBkPSJNMjQ4IDhDMTExLjAzIDggMCAxMTkuMDMgMCAyNTZzMTExLjAzIDI0OCAyNDggMjQ4IDI0OC0xMTEuMDMgMjQ4LTI0OFMzODQuOTcgOCAyNDggOHptMCA0NDhjLTExMC40OSAwLTE5OS44My04OS42MS0xOTkuODMtMjAwIDEwLjkxLTkuOTEgMTI5LjYzLTY4LjUyIDEzNS4zNC04Ni4yNGw4OS41MiA1NC42MmM3Ljk5IDMuNCAxNi45MiA1LjE5IDI1Ljk2IDUuMTkgMzQuNDIgMCA2Mi4zMy0yNy45MSA2Mi4zMy02Mi4zM3MtMjcuOTEtNjIuMzMtNjIuMzMtNjIuMzNjLTE0Ljk0IDAtMjguNjYgNS4yNS0zOS42MyAxMy44NGwtOTAuNC0xMjkuNzlDXDE4MC42OCAxMTIuNzMgMjEyLjY3IDk2IDI0OCA5NmM4OC4zNyAwIDE2MCA3MS42MyAxNjAgMTYwcz-3MS42MyAxNjAtMTYwIDE2MHoiLz48L3N2Zz4=');
}

/* === 左侧图片区域 === */

/* GitHub */
.sg-github .sg-left {
    width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.02);
    border-right: 1px solid var(--sg-border);
    flex-shrink: 0;
}
.sg-gh-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Steam: 修复图片的终极方案 */
.sg-steam .sg-left-poster {
    width: 260px;
    height: 100%;
    flex-shrink: 0;
    
    /* 核心修复代码：使用 Flex 布局强制子元素填充，消除行内元素白边 */
    display: flex;
    flex-direction: column;
    
    padding: 0;
    margin: 0;
    position: relative;
}

.sg-steam-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    
    /* 遮罩效果 */
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

/* === 右侧内容区域 === */
.sg-right {
    flex-grow: 1;
    padding: 18px 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
    min-width: 0;
}

.sg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sg-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sg-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #4b5563;
    font-weight: 600;
    flex-shrink: 0;
}

/* Steam 特有样式 */
.sg-steam .sg-title {
    font-size: 1.5rem;
}

.steam-tag {
    background: #e0f2fe;
    color: #0284c7;
}

/* 介绍文字 */
.sg-desc {
    font-size: 0.95rem;
    color: var(--sg-text-sub);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-steam .sg-desc {
    -webkit-line-clamp: 3;
}

/* 底部信息栏 */
.sg-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--sg-text-sub);
}

.sg-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.sg-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.7;
}

/* === 移动端适配 === */
@media (max-width: 600px) {
    .sg-card {
        flex-direction: column;
        height: auto;
    }
    .sg-github .sg-left {
        width: 100%;
        height: 100px;
        border-right: none;
        border-bottom: 1px solid var(--sg-border);
    }
    .sg-steam .sg-left-poster {
        width: 100%;
        height: 150px;
        mask-image: none;
        -webkit-mask-image: none;
    }
    .sg-right {
        padding: 20px;
    }
    .sg-title {
        white-space: normal;
    }
}