/* 全屏搜索页 — APP 扁平风格（无遮罩、无卡片阴影） */

body.wb-search-modal-open .search-modal-overlay {
    display: none !important;
}

body.wb-search-modal-open #header-top,
body.wb-search-modal-open .wb-statusbar {
    z-index: 1 !important;
}

.wb-search-app.search-modal {
    position: fixed;
    inset: 0;
    z-index: 100251;
    display: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--wb-app-page-bg, var(--wb-surface, #fff));
    box-shadow: none !important;
    transform: translateY(100%);
    opacity: 1;
    transition: transform .28s cubic-bezier(.22, .8, .22, 1);
}

.wb-search-app.search-modal.show {
    display: block;
}

.wb-search-app.search-modal.show.is-visible {
    transform: translateY(0);
}

.wb-search-app .search-modal-inner,
.wb-search-app__shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 !important;
    background: var(--wb-app-page-bg, var(--wb-surface, #fff));
    box-shadow: none !important;
    overflow: hidden;
}

html.theme-dark .wb-search-app.search-modal,
html.theme-dark .wb-search-app .search-modal-inner,
html.theme-dark .wb-search-app__shell,
html.theme-dark .wb-search-app__header,
html.theme-dark .wb-search-app__body,
html.theme-dark .wb-search-app .search-modal-scroll {
    background: var(--wb-app-bg, #0d1020);
}

.wb-search-app .search-modal-inner > *,
.wb-search-app__shell > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* 顶栏：返回 +（类型菜单|输入框）+ 搜索按钮 — 返回对齐原生顶栏 */
.wb-search-app__header {
    flex: 0 0 auto;
    /* 安全区单独占位，内容行高度与原生顶栏一致 */
    padding: env(safe-area-inset-top, 0px) calc(var(--wb-topbar-inline-gutter, 2px) + env(safe-area-inset-right, 0px)) 8px calc(var(--wb-topbar-inline-gutter, 2px) + env(safe-area-inset-left, 0px));
    background: var(--wb-app-page-bg, var(--wb-surface, #fff));
    border-bottom: 0;
}

.wb-search-app__form {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    min-height: var(--wb-native-topbar-h, 48px);
}

/* 图标尺寸对齐原生栏；宽度收窄，避免与搜索条之间留大空档 */
.wb-search-app__back {
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    height: var(--wb-native-topbar-h, 48px);
    min-height: 48px;
    margin: 0;
    padding: 0 0 0 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--wb-app-text, var(--wb-text, #111)) !important;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wb-search-app__back .fa {
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    transform: scaleX(1.05);
}

.wb-search-app__back:active {
    opacity: .72;
}

.wb-search-app__input-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 36px;
    padding: 3px;
    border-radius: 999px;
    background: var(--wb-app-card-soft, #f3f4f6);
    overflow: visible;
    box-sizing: border-box;
}

.wb-search-app__type-dd {
    position: relative;
    flex: 0 0 auto;
    height: 30px;
    z-index: 5;
}
.wb-search-app.is-local .wb-search-app__type-dd {
    display: none;
}
.wb-search-app__scope {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    gap: 0;
    height: 30px;
    margin: 0;
    padding: 2px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .06);
    box-sizing: border-box;
}
.wb-search-app__scope[hidden] {
    display: none !important;
}
.wb-search-app.is-local .wb-search-app__scope:not([hidden]) {
    display: inline-flex;
}
.wb-search-app__scope-btn {
    height: 26px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--wb-app-muted, #64748b);
    font-size: 12px;
    font-weight: 700;
    line-height: 26px;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.wb-search-app__scope-btn.is-on {
    background: var(--wb-app-primary, var(--wb-accent, #2563eb));
    color: #fff;
}
html.theme-dark .wb-search-app__scope {
    background: rgba(255, 255, 255, .08);
}
html.theme-dark .wb-search-app__scope-btn {
    color: #94a3b8;
}
html.theme-dark .wb-search-app__scope-btn.is-on {
    background: var(--wb-app-primary, var(--wb-accent, #2563eb));
    color: #fff;
}

.wb-search-app__type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 30px;
    margin: 0;
    padding: 0 6px 0 10px;
    border: 0;
    border-right: 1px solid rgba(148, 163, 184, .28);
    background: transparent;
    color: var(--wb-app-text, #0f172a);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wb-search-app__type-btn .fa {
    font-size: 11px;
    color: #94a3b8;
    transition: transform .18s ease;
}

.wb-search-app__type-dd.is-open .wb-search-app__type-btn .fa {
    transform: rotate(180deg);
}

.wb-search-app__type-label {
    max-width: 3.2em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-search-app__type-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 112px;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
    z-index: 30;
}

.wb-search-app__type-menu[hidden] {
    display: none !important;
}

html.theme-dark .wb-search-app__type-menu {
    background: #1a1f2e;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}

.wb-search-app__type-opt {
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.wb-search-app__type-opt.is-active,
.wb-search-app__type-opt:active {
    background: rgba(37, 99, 235, .1);
    color: #2563eb;
    font-weight: 700;
}

html.theme-dark .wb-search-app__type-btn {
    color: #e2e8f0;
    border-right-color: rgba(255, 255, 255, .12);
}

html.theme-dark .wb-search-app__type-opt {
    color: #e2e8f0;
}

html.theme-dark .wb-search-app__type-opt.is-active {
    background: rgba(37, 99, 235, .22);
    color: #93c5fd;
}

.wb-search-app__input,
.wb-search-app .search-modal-input {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 30px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--wb-app-text, var(--wb-text, #111));
    font-size: 13px;
    line-height: 30px;
    outline: none;
    box-shadow: none !important;
}

.wb-search-app__input:focus,
.wb-search-app .search-modal-input:focus {
    box-shadow: none !important;
    background: transparent;
}

.wb-search-app__input::placeholder {
    color: var(--wb-app-muted, var(--wb-muted, #94a3b8));
}

.wb-search-app__clear {
    position: static;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--wb-app-muted, #94a3b8);
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: none;
    z-index: 2;
}
.wb-search-app__clear[hidden] {
    display: none !important;
}

.wb-search-app__submit,
.wb-search-app .search-modal-submit {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: 30px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 999px !important;
    background: var(--wb-app-primary, var(--wb-accent, #2563eb)) !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 30px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none !important;
    filter: none !important;
}

.wb-search-app__submit:active,
.wb-search-app .search-modal-submit:active {
    opacity: .88;
    transform: none;
}

.wb-search-app__submit .fa,
.wb-search-app .search-modal-submit .fa,
.wb-search-app .search-modal-submit span {
    display: none;
}

/* 主体滚动区 */
.wb-search-app__body,
.wb-search-app .search-modal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 max(16px, env(safe-area-inset-bottom, 0px));
    background: var(--wb-app-page-bg, var(--wb-surface, #fff));
}

/* 图标横向轮播 / 跑马灯 */
.wb-search-app__icons {
    margin: 4px 0 0;
    padding: 0;
}

.wb-tubiao-lunbo {
    margin: 0;
    padding: 8px 0 4px;
    overflow: hidden;
}

.wb-tubiao-lunbo__viewport {
    overflow: hidden;
    width: 100%;
}

.wb-tubiao-lunbo__track {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 0 14px 6px;
    width: max-content;
    will-change: transform;
    transform: translate3d(0,0,0);
    cursor: grab;
    touch-action: pan-y;
}

.wb-tubiao-lunbo__track.is-dragging {
    cursor: grabbing;
}

.wb-tubiao-lunbo__item {
    flex: 0 0 auto;
    width: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    color: var(--wb-app-text, #111);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.wb-tubiao-lunbo__ico {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: none;
    border: 0;
}

.wb-tubiao-lunbo__ico img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.wb-tubiao-lunbo__txt {
    display: block;
    width: 100%;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--wb-app-text, #334155);
}

html.theme-dark .wb-tubiao-lunbo__ico {
    background: #1f2937;
}

html.theme-dark .wb-tubiao-lunbo__txt {
    color: #cbd5e1;
}

/* 热门标签：等宽网格对齐 */
.wb-search-app__section,
.wb-search-app .search-modal-hot {
    display: block !important;
    margin: 0;
    padding: 10px 14px 0;
}

.wb-search-app__section-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wb-search-app__section-title,
.wb-search-app .search-modal-hot-title {
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--wb-app-text, var(--wb-text, #111));
    text-align: left;
}

.wb-search-app__hot-refresh {
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.wb-search-app__hot-refresh.is-spin .fa {
    animation: wb-search-spin .45s linear;
}

@keyframes wb-search-spin {
    to { transform: rotate(360deg); }
}

.wb-search-app__chips,
.wb-search-app .search-modal-hot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
}

.wb-search-app__chip,
.wb-search-app .search-hot-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    width: 100%;
    max-width: 100%;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: var(--wb-app-card-soft, #f3f4f6);
    color: var(--wb-app-text, var(--wb-text, #334155));
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    box-shadow: none !important;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wb-search-app__chip:active,
.wb-search-app .search-hot-chip:active {
    opacity: .78;
}

html.theme-dark .wb-search-app__chip,
html.theme-dark .wb-search-app .search-hot-chip {
    background: rgba(255, 255, 255, .08);
    color: #e2e8f0;
}

/* 相关热推 */
.wb-search-app__ads {
    margin: 4px 14px 0;
}

.wb-search-app__ads .wb-searchbox-ads {
    margin-top: 12px;
    padding-top: 0;
    border-top: 0;
}

.wb-search-app__ads .wb-searchbox-ads__item {
    box-shadow: none;
    border: 0;
}

/* 人气榜 + 标准视频卡片 */
.wb-search-app__rank {
    margin: 8px 0 0;
    padding: 4px 10px 12px;
}

.wb-search-app__rank-tabs {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0;
    margin: 0 4px 12px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    background: transparent;
}

.wb-search-app__rank-tab {
    position: relative;
    flex: 1 1 0;
    height: 34px;
    margin: 0;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 400;
    line-height: 34px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wb-search-app__rank-tab.is-active {
    color: #0f172a;
    font-weight: 500;
}

.wb-search-app__rank-tab.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 16px;
    height: 2px;
    margin-left: -8px;
    border-radius: 999px;
    background: #ef4444;
}

html.theme-dark .wb-search-app__rank-tabs {
    border-bottom-color: rgba(255, 255, 255, .08);
}

html.theme-dark .wb-search-app__rank-tab {
    color: #94a3b8;
}

html.theme-dark .wb-search-app__rank-tab.is-active {
    color: #f8fafc;
}

.wb-search-app__rank-pane[hidden] {
    display: none !important;
}

.wb-search-app__vodlist {
    margin: 0 !important;
    padding: 0 !important;
}

.wb-search-app__vodlist > li {
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .wb-search-app.search-modal {
        left: 50%;
        right: auto;
        width: 100%;
        max-width: var(--wb-app-shell-max, 960px);
        transform: translate(-50%, 100%);
    }

    .wb-search-app.search-modal.show.is-visible {
        transform: translate(-50%, 0);
    }

    .wb-search-app__chips,
    .wb-search-app .search-modal-hot-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .wb-tubiao-lunbo__item {
        width: 64px;
    }

    .wb-tubiao-lunbo__ico {
        width: 56px;
        height: 56px;
    }
}
