/* 方舟STEAM入库助手 - 自定义样式 */

/* 侧栏广告约束：防止广告内容溢出 grid 列 */
#adSlotLeftNative,
#adSlotRightSidebar {
    max-width: 100%;
    overflow: hidden;
}

#adSlotLeftNative img,
#adSlotRightSidebar img {
    max-width: 100% !important;
    height: auto !important;
}

#adSlotLeftNative iframe,
#adSlotRightSidebar iframe {
    max-width: 100% !important;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* 游戏列表项 */
.game-item {
    transition: all 0.2s ease;
}

.game-item:hover {
    transform: translateX(4px);
    border-color: #2563EB;
    background-color: #EFF6FF;
}

.game-item.selected {
    border-color: #2563EB !important;
    background-color: #DBEAFE !important;
}

/* 日志条目动画 */
.log-entry {
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载动画 */
.loading-spinner {
    animation: spin 1s linear infinite;
}

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

/* 输入框聚焦效果增强 */
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .game-item:hover {
        transform: none;
    }
}

/* 选择框样式 */
input[type="checkbox"] {
    accent-color: #2563EB;
}

/* 无障碍：减少动画 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 可交互元素 cursor */
button, [role="button"], summary, label[for], .game-item {
    cursor: pointer;
}

/* 触摸目标最小尺寸 */
@media (pointer: coarse) {
    button, a, select, input[type="checkbox"] {
        min-height: 44px;
        min-width: 44px;
    }
    nav a {
        padding: 0.5rem 0.75rem;
    }
}

/* 主页移动端：汉堡菜单 */
#mobileMenuBtn {
    display: none;
}

@media (max-width: 768px) {
    #mobileMenuBtn {
        display: flex;
    }
    #mainNav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid #E2E8F0;
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.25rem;
        z-index: 40;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    #mainNav.open {
        display: flex;
    }
    #mainNav a {
        padding: 0.625rem 0.75rem;
        border-radius: 0.5rem;
        transition: background 0.15s;
    }
    #mainNav a:hover {
        background: #F1F5F9;
    }
    /* 移动端隐藏状态 badge */
    .header-badges {
        display: none;
    }
    .header-badges.open {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* 操作面板折叠区块 */
details.action-section > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s;
}

details.action-section > summary::-webkit-details-marker {
    display: none;
}

details.action-section > summary::after {
    content: '';
    width: 1.25rem;
    height: 1.25rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") center/contain no-repeat;
    transition: transform 0.2s;
    flex-shrink: 0;
}

details.action-section[open] > summary::after {
    transform: rotate(180deg);
}

details.action-section > summary:hover {
    background: rgba(0, 0, 0, 0.03);
}

details.action-section > .action-content {
    padding: 0.75rem 0 0;
}