/* 全屏搜索页 — 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: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
    background: var(--wb-app-page-bg, var(--wb-surface, #fff));
    border-bottom: 0;
}

html.theme-dark .wb-search-app__header {
    border-bottom-color: transparent;
}

.wb-search-app__form {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
}

.wb-search-app__back {
    flex: 0 0 40px;
    width: 40px;
    height: 42px;
    margin: 0 6px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--wb-app-text, var(--wb-text, #111));
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

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

.wb-search-app__input-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.wb-search-app__input,
.wb-search-app .search-modal-input {
    display: block;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 34px 0 14px;
    border: 0;
    border-radius: 12px 0 0 12px;
    background: var(--wb-app-card-soft, var(--wb-input-bg, #f3f4f6));
    color: var(--wb-app-text, var(--wb-text, #111));
    font-size: 15px;
    line-height: 42px;
    outline: none;
    box-shadow: none !important;
}

.wb-search-app__input:focus,
.wb-search-app .search-modal-input:focus {
    box-shadow: none !important;
    background: var(--wb-app-card-soft, var(--wb-input-bg, #f3f4f6));
}

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

.wb-search-app__clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--wb-app-muted, #94a3b8);
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

html.theme-dark .wb-search-app__clear {
    background: transparent;
}

.wb-search-app__submit,
.wb-search-app .search-modal-submit {
    flex: 0 0 60px;
    width: 60px;
    height: 42px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 0 12px 12px 0;
    background: var(--wb-app-primary, var(--wb-accent, #2563eb));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 42px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 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__types,
.wb-search-app .search-modal-filter {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    margin: 8px 16px 0;
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    border: 0;
    border-radius: 12px;
    background: var(--wb-app-card-soft, #f3f4f6);
}

.wb-search-app__types::-webkit-scrollbar {
    display: none;
}

html.theme-dark .wb-search-app__types {
    border-bottom-color: rgba(255, 255, 255, .05);
}

.wb-search-app__type,
.wb-search-app .search-radio {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    margin: 0;
    padding: 0 12px;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wb-search-app__type .dot {
    display: none !important;
}

.wb-search-app__type .text {
    font-size: 13px;
    font-weight: 500;
    color: var(--wb-app-text, var(--wb-text, #334155));
}

.wb-search-app__type.is-active,
.wb-search-app .search-radio.is-active,
.wb-search-app__type:has(input:checked),
.wb-search-app .search-radio:has(input:checked) {
    background: var(--wb-app-primary, var(--wb-accent, #2563eb));
}

.wb-search-app__type.is-active .text,
.wb-search-app .search-radio.is-active .text,
.wb-search-app__type:has(input:checked) .text,
.wb-search-app .search-radio:has(input:checked) .text {
    color: #fff;
    font-weight: 600;
}

/* 资源概览：等宽信息卡，避免数字悬空 */
.wb-search-app__stats,
.wb-search-app .search-modal-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    flex-direction: row !important;
    align-items: stretch;
    gap: 8px;
    margin: 0;
    padding: 16px;
}

.wb-search-app__stats::before,
.wb-search-app .search-modal-counts::before {
    content: "资源概览";
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 700;
    color: var(--wb-app-text, var(--wb-text, #111));
}

.wb-search-app__stats:empty {
    display: none;
    padding: 0;
}

.wb-search-app__stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--wb-app-card-soft, #f3f4f6);
    box-sizing: border-box;
    font-size: 12px;
    color: var(--wb-app-muted, var(--wb-muted, #64748b));
}

.wb-search-app__stat em {
    font-style: normal;
}

.wb-search-app__stat strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--wb-accent, #2563eb);
}

.wb-search-app .search-count-card {
    display: none;
}

/* 热门搜索 */
.wb-search-app__section,
.wb-search-app .search-modal-hot {
    display: block !important;
    margin: 0;
    padding: 8px 16px 0;
}

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

.wb-search-app__chips,
.wb-search-app .search-modal-hot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.wb-search-app__chip,
.wb-search-app .search-hot-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--wb-app-card-soft, #f3f4f6);
    color: var(--wb-app-text, var(--wb-text, #334155));
    font-size: 13px;
    text-decoration: none !important;
    box-shadow: none !important;
}

html.theme-dark .wb-search-app__chip,
html.theme-dark .wb-search-app .search-hot-chip {
    border-color: rgba(255, 255, 255, .1);
}

.wb-search-app__chip:active,
.wb-search-app .search-hot-chip:active {
    background: var(--wb-app-card-soft, rgba(0, 0, 0, .04));
    transform: none;
}

.wb-search-app__ads {
    margin-top: 14px;
}

@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);
    }
}
