.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: #ffffff;
    z-index: 10000;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    border-left: 1px solid #e0e0e0;
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    transform: translateZ(0); /* 硬件加速 */
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    border-bottom: 2px solid #e74c3c;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-content {
    padding: 0;
}

.lottery-section {
    border-bottom: 1px solid #f0f0f0;
    margin: 8px 0;
}

.lottery-section:last-child {
    border-bottom: none;
}

.lottery-title {
    padding: 12px 16px 8px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
    border-left: 4px solid #e74c3c;
    margin: 0 12px;
    border-radius: 0 6px 6px 0;
}

.lottery-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 12px 16px 16px;
}

.lottery-link {
    display: block;
    padding: 10px 6px;
    text-decoration: none;
    color: #666666;
    font-size: 12px;
    font-weight: 500;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.lottery-link:hover {
    background: #f8f9fa;
    color: #e74c3c;
    border-color: #e74c3c;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.15);
}

.lottery-link:active {
    transform: translateY(0);
}

/* 响应式调整 */
@media (max-width: 360px) {
    .sidebar {
        width: 90%;
    }

    .lottery-links {
        grid-template-columns: repeat(4, 1fr);
    }

    .lottery-link {
        padding: 12px 15px;
        font-size: 15px;
    }
}

/* 移动设备优化 */
@media (max-width: 480px) {
    .sidebar {
        width: 85%;
        max-width: none;
    }

    .sidebar-header {
        padding: 12px 15px;
    }

    .sidebar-header h3 {
        font-size: 16px;
    }

    .lottery-title {
        padding: 5px 15px 8px;
        font-size: 15px;
    }

    .lottery-links {
        padding: 5px 5px;
        gap: 2px;
    }

    .lottery-link {
        padding: 5px 5px;
        font-size: 13px;
    }
}

/* 防止侧边栏打开时页面滚动 */
body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}


