/* Story 50 - 移动端界面布局优化 */

/* ============================================
   1. 详情框可折叠样式
   ============================================ */

.collapsible-section {
    margin-top: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 12px;
    background: #1a1a1a;
    border-radius: 6px;
    transition: background 0.2s;
    user-select: none;
}

.section-header:hover {
    background: #252525;
}

.section-header h3,
.section-header h4 {
    margin: 0;
    font-size: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-arrow {
    color: #888;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.section-header[aria-expanded="true"] .toggle-arrow {
    transform: rotate(180deg);
}

.section-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
    padding-top: 12px;
}

.section-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
}

/* ============================================
   2. 移动端缩略图模式
   ============================================ */

@media (max-width: 600px) {
    #image-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .image-card img {
        height: 130px !important;
    }
    
    .card-info {
        font-size: 10px !important;
        padding: 6px 4px !important;
    }
    
    .card-badges {
        top: 4px;
        right: 4px;
        gap: 2px;
    }
    
    .badge {
        font-size: 10px;
        padding: 2px 4px;
    }
}

/* ============================================
   3. 游戏界面 UI 隐藏功能
   ============================================ */

/* 隐藏 UI 按钮 - 右下角汉堡菜单风格 */
#toggle-ui-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    z-index: 10000;
    pointer-events: auto;
    padding: 0;
}

#toggle-ui-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* 汉堡菜单图标 */
.hamburger-icon {
    width: 20px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #ccc;
    border-radius: 1px;
    transition: all 0.3s;
}

#toggle-ui-btn:hover .hamburger-icon span {
    background: white;
}

/* UI 隐藏状态 */
.top-bar.ui-hidden,
.bottom-bar.ui-hidden {
    opacity: 0;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
}

/* 确保隐藏UI中的所有子元素也不拦截事件 */
.top-bar.ui-hidden *,
.bottom-bar.ui-hidden * {
    pointer-events: none !important;
}

/* 移动端隐藏UI按钮位置 */
@media (max-width: 600px) {
    #toggle-ui-btn {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }
    
    .hamburger-icon {
        width: 22px;
        height: 18px;
    }
    
    .hamburger-icon span {
        height: 3px;
    }
}
