/* Shared by the PC and WAP footer slots. */
.xl-bottom-ad {
    position: fixed;
    z-index: 9990;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
    overflow: visible;
}
.xl-bottom-ad--wap { max-width: 640px; }
.xl-bottom-ad[hidden] { display: none !important; }

/* PC 底部广告顶栏与关闭按钮现代化重构 */
.xl-bottom-ad--pc .xl-bottom-ad__bar {
    position: absolute;
    left: 0;
    right: 0;
    top: -26px;
    height: 26px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    padding: 0;
}

.xl-bottom-ad--pc .xl-bottom-ad__bar::before {
    content: "推广 广告";
    height: 22px;
    line-height: 22px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    border-radius: 4px 4px 0 0;
    letter-spacing: 0.5px;
    margin-left: 12px;
    pointer-events: auto;
}

.xl-bottom-ad--pc .xl-bottom-ad__close {
    pointer-events: auto;
    height: 26px;
    line-height: 26px;
    min-width: 58px;
    padding: 0 12px;
    border-radius: 6px 6px 0 0;
    background: rgba(30, 41, 59, 0.88);
    backdrop-filter: blur(8px);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.xl-bottom-ad--pc .xl-bottom-ad__close:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.xl-bottom-ad__close:focus-visible { outline: 2px solid #1677ff; outline-offset: -2px; }

.xl-bottom-ad__content {
    max-height: 25vh;
    overflow: auto;
    text-align: center;
    overflow-wrap: break-word;
    border-radius: 8px 8px 0 0;
}
.xl-bottom-ad--pc .xl-bottom-ad__content {
    padding: 4px 0;
}
.xl-bottom-ad__content img { max-width: 100% !important; height: auto !important; vertical-align: middle; }
.xl-bottom-ad__content iframe, .xl-bottom-ad__content video { max-width: 100%; }

/* PC 底部广告夜间模式 */
html[data-theme-mode="night"] .xl-bottom-ad--pc {
    background: rgba(17, 24, 34, 0.98);
    border-top: 1px solid #243242;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
}

html[data-theme-mode="night"] .xl-bottom-ad--pc .xl-bottom-ad__close {
    background: rgba(30, 41, 59, 0.9);
    border-color: #334155;
    color: #94a3b8;
}

html[data-theme-mode="night"] .xl-bottom-ad--pc .xl-bottom-ad__close:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* ==========================================================================
   WAP 底部浮动广告 (Swiss Minimalism + shadcn/ui Floating Card)
   ========================================================================== */
.xl-bottom-ad--wap {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 9998 !important;
    background: #ffffff !important;
    border: 1px solid #e4e4e7 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease !important;
}

[data-theme="dark"] .xl-bottom-ad--wap,
html[data-theme-mode="night"] .xl-bottom-ad--wap,
.dark .xl-bottom-ad--wap {
    background: #18181b !important;
    border-color: #27272a !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6) !important;
}

/* 顶部操作条 (绝对定位在横幅右上角内嵌，不遮挡上方文章) */
.xl-bottom-ad--wap .xl-bottom-ad__bar {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    left: auto !important;
    bottom: auto !important;
    height: auto !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    pointer-events: auto !important;
}

/* 广告标签 (左上角微型标识) */
.xl-bottom-ad--wap::before {
    content: "广告";
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 4px;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* 关闭按钮：精致毛玻璃胶囊，触控区域舒适 */
.xl-bottom-ad--wap .xl-bottom-ad__close {
    height: 22px !important;
    line-height: 20px !important;
    min-width: 44px !important;
    padding: 0 7px !important;
    border-radius: 9999px !important;
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 180ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
}

.xl-bottom-ad--wap .xl-bottom-ad__close:hover {
    background: rgba(239, 68, 68, 0.9) !important;
    border-color: rgba(239, 68, 68, 0.9) !important;
    color: #ffffff !important;
}

.xl-bottom-ad--wap .xl-bottom-ad__close:active {
    transform: scale(0.96) !important;
}

/* 广告内容与图片展示 (保证自然比例，绝不强行裁切腰斩图片文字) */
.xl-bottom-ad--wap .xl-bottom-ad__content {
    width: 100% !important;
    height: auto !important;
    max-height: 90px !important;
    overflow: hidden !important;
    display: block !important;
    border-radius: 11px !important;
    background: #000000 !important;
}

.xl-bottom-ad--wap .xl-bottom-ad__content .caClass,
.xl-bottom-ad--wap .xl-bottom-ad__content p,
.xl-bottom-ad--wap .xl-bottom-ad__content a {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: 90px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.xl-bottom-ad--wap .xl-bottom-ad__content img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 50px !important;
    max-height: 90px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    object-fit: contain !important;
    border-radius: 11px !important;
}

/* 确保底部 5 栏始终高于浮动条 */
.xl-wap-bottom-bar {
    z-index: 10000 !important;
}

/* 页面底部留白缓冲，确保最后一篇内容不被浮动条覆盖 */
.newBox,
#newListArea {
    padding-bottom: 20px !important;
}
.bottomBox {
    margin-bottom: 40px !important;
}

/* ==========================================================================
   WAP 快捷分类抽屉弹窗
   ========================================================================== */
#xlCategoryDrawer,
.xl-wap-drawer-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999999 !important;
  background: rgba(9, 9, 11, 0.6) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  align-items: flex-end !important;
  justify-content: center !important;
}
.xl-wap-drawer-card {
  position: relative !important;
  z-index: 10000000 !important;
  width: 100% !important;
  max-width: 640px !important;
  margin: 0 auto !important;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  border-radius: 16px 16px 0 0 !important;
  background: var(--xl-bg-card, #ffffff) !important;
  border-top: 1px solid var(--xl-border, #e4e4e7) !important;
  box-shadow: 0 -12px 32px rgba(9, 9, 11, 0.18) !important;
  box-sizing: border-box !important;
}
html[data-theme-mode="night"] .xl-wap-drawer-card {
  background: #18181b !important;
  border-top-color: #27272a !important;
}
