
:root {
    --sb-bg-gradient: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    --sb-sidebar-bg: #ffdadc;
    --sb-white: #ffffff;
    --sb-text-dark: #333;
    --sb-blue-accent: #4a90e2;
    --sb-purple-accent: #9c27b0;
    --sb-gap: 10px;
    --sb-radius: 12px;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0; padding: 0;
    background-image: var(--sb-bg-gradient);
    background-attachment: fixed;
    color: var(--sb-text-dark);
    overflow-x: hidden;
}

* { box-sizing: border-box; }
a { text-decoration: none; color: inherit; }

.sb-main-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

/* --- 头部结构保留，仅增强搜索框 --- */
.sb-header-area { margin-bottom: 20px; }
.sb-top-bar { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }

.sb-logo-box {
    background: var(--sb-white);
    padding: 10px 15px;
    border-radius: var(--sb-radius);
    font-weight: bold;
    color: #e91e63;
    font-size: 24px;
    display: flex;
    align-items: center; gap: 10px;
}

.sb-main-search {
    background: var(--sb-white);
    padding: 5px 20px;
    border-radius: 30px;
    flex-grow: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 新增：输入框样式，保持与原设计融合 */
.sb-main-search input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 8px 0;
    font-size: 14px;
    color: var(--sb-text-dark);
}

.sb-main-search i { color: var(--sb-blue-accent); cursor: pointer; padding: 5px; }

/* 分类标签：增加手机端滑动支持，不改变外观 */
.sb-tag-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
}
.sb-tag-filters::-webkit-scrollbar { display: none; } /* Chrome 隐藏滚动条 */

.sb-tag {
    background: var(--sb-white);
    color: var(--sb-blue-accent);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #dceeff;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* --- 游戏网格结构 --- */
.sb-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    grid-auto-rows: 80px;
    grid-auto-flow: dense;
    gap: var(--sb-gap);
}

.sb-tile {
    background: var(--sb-white);
    border-radius: var(--sb-radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

/* 修改：div > a > img 结构 */
.sb-tile a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.sb-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 新增：悬停显示名称 */
.sb-tile-overlay-name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 10px;
    padding: 8px 2px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-tile:hover { transform: scale(1.05); z-index: 10; }

/* 跨度类（完全保留） */
.span-1x1 { grid-column: span 1; grid-row: span 1; }
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-2x1 { grid-column: span 2; grid-row: span 1; }
.span-1x2 { grid-column: span 1; grid-row: span 2; }
.span-3x3 { grid-column: span 3; grid-row: span 3; }
.span-4x4 { grid-column: span 4; grid-row: span 4; }

/* --- 侧边栏及底部区域（完全保留） --- */
.sb-sidebar {
    position: fixed; top: 0; left: 0; width: 320px; height: 100vh;
    background-color: var(--sb-sidebar-bg); z-index: 2000;
    padding: 20px; transform: translateX(-100%); transition: transform 0.3s ease;
}
.sb-sidebar.active { transform: translateX(0); }
.sb-close-sidebar-btn { position: absolute; top: 20px; right: -40px; width: 30px; height: 30px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 2px 0 5px rgba(0,0,0,0.1); }

body.sidebar-open .sb-main-container { transform: translateX(320px); opacity: 0.5; pointer-events: none; }

.sb-bottom-section { margin-top: 40px; background: rgba(255,255,255,0.3); padding: 30px 20px; border-radius: 20px 20px 0 0; }
.sb-wide-categories-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-bottom: 30px; }
.sb-wide-cat-btn { display: flex; border-radius: 12px; overflow: hidden; height: 60px; background: white; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.sb-wide-cat-img { width: 80px; height: 100%; object-fit: cover; }
.sb-wide-cat-text { flex-grow: 1; padding: 0 15px; font-weight: bold; font-size: 14px; text-transform: uppercase; }
.cat-purple { background: #e1bee7; color: #4a148c; }
.cat-pink { background: #f8bbd0; color: #880e4f; }

.sb-about-box { background: var(--sb-white); padding: 30px; border-radius: var(--sb-radius); margin-bottom: 30px; line-height: 1.6; }
.sb-footer { border-top: 1px solid rgba(255,255,255,0.5); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #666; flex-wrap: wrap; gap: 15px; }

@media (max-width: 600px) {
    .sb-main-search { max-width: none; width: 100%; }
    .sb-header-area { margin-bottom: 10px; }
}