@media (min-width: 960px) {
  .popup {
    display: block;
    /* 确保它存在，但初始状态隐藏 */
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    /* background: rgba(0, 0, 0, 0.45); */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  }

  .popup .popup_content {
    position: absolute;
    left: -300px;
    /* 初始隐藏在左侧 */
    top: 0;
    height: 100%;
    width: 250px;
    /* 侧边栏宽度 */
    background-color: #161920;
    padding: 20px;
    transition: left 0.3s ease-in-out;
  }

  /* 侧边栏内容 */
  .popup .popup_content .menu_list {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .popup .popup_content .menu_list .logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 20px;
    justify-content: center !important;
  }

  .popup .popup_content .menu_list .logo .logo_icon {
    width: 100px;
  }

  .popup .popup_content .menu_list .menu_item {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .popup .popup_content .menu_list .menu_item img {
    width: 24px;
    height: 24px;
    margin-right: 20px;
  }

  /* 关闭按钮 */
  .popup .popup_content .menu_list .close_btn {
    width: 90%;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(to bottom, #308ED7, #5860D3);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .popup .popup_content .close_icon img {
    width: 100%;
    height: 100%;
  }

  /* 当 `open-popup` 类被添加时，菜单滑入 */
  .popup.open-popup {
    opacity: 1;
    visibility: visible;
  }

  .popup.open-popup .popup_content {
    left: 0;
  }

  .NewGames {
    font-size: 12px;
    color: #bdbfce;
    margin-top: 10px;
  }

  .menu_item {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .menu_item img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
  }
}

@media (max-width: 960px) {

  body.popup-active {
    background: rgba(0, 0, 0, 0.5);
    transition: filter 0.3s ease-in-out;

  }

  body.popup-active .container {
    filter: blur(5px);
  }

  .popup {
    display: block;
    position: fixed;
    top: 0;
    left: -80vw;
    /* width: 260px; */
    height: 100vh;
    background: #fff;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 12;
    overflow-y: auto;
  }

  .popup.open-popup {
    left: 0;
  }

  .popup .popup_content {
    width: 100%;
    height: 100%;
    background-color: #0B0B15;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.3);
  }

  .popup .popup_content .menu_list {
    padding: 20px;
    /* display: flex; */
    flex-direction: column;
    align-items: center;
    background-color: #0B0B15;
    overflow-y: auto;
  }

  .popup .popup_content .menu_list .logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 20px;
    justify-content: center !important;
  }

  .popup .popup_content .menu_list .logo .logo_icon {
    width: 130px;
  }

  .popup .popup_content .menu_list .menu_item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    color: #8F9BB3;
    border-radius: 12px;
    transition: all 0.3s ease;
    gap: 12px;
    margin-bottom: 2px;
    box-sizing: border-box;
  }

  .popup .popup_content .menu_list .menu_item.active {
    background: linear-gradient(90deg, rgba(108, 92, 231, 0.15) 0%, rgba(108, 92, 231, 0) 100%);
    color: #6C5CE7;
    border-left: 3px solid #6C5CE7;
    border-radius: 4px 12px 12px 4px;
  }

  .popup .popup_content .menu_list .menu_item.active img {
    filter: drop-shadow(0 0 5px rgba(108, 92, 231, 0.5));
    opacity: 1;
  }

  .popup .popup_content .menu_list .menu_item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
  }

  .popup .popup_content .menu_list .menu_item img {
    width: 20px;
    height: 20px;
    margin-right: 0;
    opacity: 0.8;
  }

  .popup .popup_content .menu_list .menu_item:hover img {
    transform: scale(1.1);
    opacity: 1;
  }

  .popup .popup_content .close_btn {
    width: 100%;
    padding: 12px;
    background: #6C5CE7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    margin-top: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 162, 254, 0.3);
  }

  .popup .popup_content .NewGames {
    color: #8F9BB3;
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
    padding-bottom: 20px;
  }

  /* Styles for content copied from sidebar */
  .popup .popup_content .sidebar_browse {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .popup .popup_content .logo_img {
    display: none; /* Hide duplicate logo if present */
  }

  .popup .popup_content .top-home-link {
    display: flex;
    padding: 12px 16px;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #8F9BB3;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 2px;
    text-decoration: none;
  }

  .popup .popup_content .top-home-link img {
    width: 20px;
    height: 20px;
    opacity: 0.8;
  }

  .popup .popup_content .top-home-link a {
    color: inherit;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
  }

  .popup .popup_content .top-home-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
  }

  .popup .popup_content .top-home-link.selected {
    background: linear-gradient(90deg, rgba(108, 92, 231, 0.15) 0%, rgba(108, 92, 231, 0) 100%);
    color: #6C5CE7;
    border-left: 3px solid #6C5CE7;
    border-radius: 4px 12px 12px 4px;
  }

  .popup .popup_content .right-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
  }

  .popup .popup_content .right-content .Privacy {
    padding: 12px 16px;
    color: #8F9BB3;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: color 0.2s ease;
    text-decoration: none;
  }

  .popup .popup_content .right-content .Privacy:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 12px;
  }

  .popup .popup_content .right-content .Privacy img {
    width: 20px;
    height: 20px;
    opacity: 0.5;
  }

  .popup .popup_content .right-content .Privacy a {
    color: inherit;
    text-decoration: none;
  }

  .popup .popup_content .sidebar_browse_group {
    display: none; /* Hide filters if not needed in popup */
  }
}