.app-search-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    /* 使用可见性+指针事件来避免 display 切换带来的动画丢失 */
    display: block;
    visibility: hidden;
    pointer-events: none;
   
}

.app-search-modal.is-open {
    visibility: visible;
    pointer-events: auto
}

.app-search-modal-open {
    overflow: hidden
}

.app-search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    opacity: 0;
    transition: opacity 2s ease
}

.app-search-modal__dialog {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2;
    box-sizing: border-box;
    width: 100vw;
    height: 720px;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 1.5s cubic-bezier(.25,.8,.25,1);
    will-change: transform;
    background-image: url('https://www.gamelady.net/wp-content/uploads/2025/11/search-bg.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    padding-bottom: 50px;
    max-height: 80vh;
    overflow-y: auto;
}

.is-open .app-search-modal__dialog {
    transform: translateY(0)
}
.is-open .app-search-modal__backdrop{
    opacity: 1
}

/* 关闭时立即隐藏：禁用过渡 */
.app-search-modal.closing .app-search-modal__dialog{
    transition: none !important;
}
.app-search-modal.closing .app-search-modal__backdrop{
    transition: none !important;
}



.app-search-modal__header {
    padding: 16px 0px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between
}

/* 关闭按钮（默认隐藏，仅移动端显示） */
.app-search-close-btn{
    display: none;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0 0 0 8px;
    line-height: 0;
}

.app-search-close-btn{ display:none; }

/* 新搜索框容器（金色边框 + 圆形放大镜按钮） */
.app-search-field{
    position: relative;
    box-sizing: border-box;
    margin-right: auto;
    width: 100%;
    height: 40px;
    border: 1px solid #EBB775;
    border-radius: 20px;
    background: #0f0f0f;
    padding-left: 14px;
    padding-right: 44px;
    display: flex;
    align-items: center
}

.app-search-input {
    flex: 1 1 auto;
    height: 100%;
    padding: 0 8px 0 0;
    border: none !important;
    border-radius: 0;
    outline: none !important;
    background: transparent !important;
    color: #ddd !important
}

.app-search-input::placeholder {
    color: #777
}

.app-search-icon-btn{
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #EBB775;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer
}

.app-search-icon-btn svg{
    display: block
}
#app-search-submit{
    border: none;
}
/* 加载态样式 */
.app-search-icon-btn.is-loading svg{
    display: none;
}
.app-search-icon-btn.is-loading:after{
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #EBB775;
    border-top-color: transparent;
    border-radius: 50%;
    animation: app-spin .8s linear infinite;
}
@keyframes app-spin{
    to{ transform: rotate(360deg); }
}



.app-search-modal__body {
    padding: 6px 20px 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.app-search-content {
    display: flex;
    gap: 24px;
    min-height: 0;
    flex: 1 1 auto;
    padding-left: 10rem;
}

.app-search-left {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column
}

.app-reco-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 10px;
    color: #e6c270
}

.app-reco-title {
    font-size: 24px
}

.app-reco-nav {
    display: flex;
    gap: 8px;
    align-items: center
}

.app-reco-nav .swiper-button-prev,
.app-reco-nav .swiper-button-next {
    position: static;
    width: 28px;
    height: 28px;
    border: 1px solid #EBB775;
    background: #1b1b1b;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0
}

.app-reco-nav .swiper-button-prev:after,
.app-reco-nav .swiper-button-next:after {
    font-size: 14px;
    color: #EBB775;
}

.app-reco-swiper.swiper {
    box-sizing: border-box;
    width: 100%;
}
.app-reco-swiper .swiper-wrapper {
    height: 100%;
}
.app-reco-swiper .swiper-slide {
    height: auto;
}

.app-reco-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #ddd;
    overflow: hidden
}
.app-reco-card-item{
    border: 1px solid #EBB775;
    padding: 10px;
}

.app-reco-card .pic {
    display: block;
    overflow: hidden;
    background: #0e0e0e;
    border: 1px solid #EBB775;
}

.app-reco-card .pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.app-reco-card .meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px
}
.app-reco-rating{
    display: flex;
    align-items: center;
    gap: 8px;
}
.app-reco-rating .star-rating{
    margin: 0;
}
.app-reco-rating-count{
    color: #ddd;
    font-size: 12px;
}

.app-reco-card .t {
    font-size: 13px;
    line-height: 1.4;
    color: #ddd
}

.app-reco-card .p bdi {
    font-size: 16px !important;
    color: #fff !important;
}

.app-search-right {
    flex: 0 0 32%;
    padding-left: 50px;
    overflow: auto
}
.app-right-list-item{
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #EBB775;
    padding: 10px 0;

}
/* 新的搜索结果网格（默认隐藏） */
.app-search-results{
    display: none;
}
.app-search-results.is-visible{
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 18px;
    overflow-y: auto;
    /* Firefox */
    scrollbar-color: #444 #e6c270; /* thumb track */
    scrollbar-width: thin;
}
@media (max-width: 767px){
    .app-search-results.is-visible{
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}
/* 无结果提示：在网格中居中显示并跨越整行 */
.app-search-results .app-search-no-result{
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
    color: #ddd;
    font-size: 16px;
}
.app-search-results .app-search-loading{
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
    color: #ddd;
    font-size: 16px;
}
/* WebKit */
.app-search-results.is-visible::-webkit-scrollbar{
    width: 10px;
    height: 10px;
}
.app-search-results.is-visible::-webkit-scrollbar-track{
    background: #e6c270;
}
.app-search-results.is-visible::-webkit-scrollbar-thumb{
    background: #444;
    border-radius: 6px;
}

.app-right-title {
    margin: 6px 0 10px;
    color: #e6c270;
    font-size: 24px;
    margin-top: 20px;
}

.app-right-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.app-right-list a {
    text-decoration: none;
    color: #ddd
}

.app-right-list a:hover {
    color: #fff
}

.app-search-result-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: calc(100% - 10px);
    overflow: auto
}

.app-search-result-item {
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
    background: #141414
}

.app-search-result-link {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit
}

.app-search-result-link .thumb {
    flex: 0 0 auto;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center
}

.app-search-result-link .thumb img {
    max-width: 60px;
    height: auto;
    border-radius: 4px
}

.app-search-result-link .meta {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.app-search-result-link .title {
    font-size: 14px;
    line-height: 1.3
}

.app-search-result-link .price {
    font-size: 13px;
    color: #d22
}

.app-search-no-result,
.app-search-divider {
    padding: 10px 12px;
    color: #666
}

.app-search-open-btn {
    height: 40px;
    width: 24px;
   
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: unset !important;
    border: none;
    padding: 0;
    margin: 0
}

.app-search-open-btn svg {
    width: 24px !important;
    height: 24px !important;
    display: block
}

.wd-header-search-form .searchform,
.wd-header-search-form .search-results-wrapper {
    display: none !important
}

@media (max-width: 767px){
    .wd-search-form{
        display: none !important;
    }
    .app-search-modal__body{
        padding-top: 0;
    }
    /* 头部固定，并显示右侧关闭按钮（在输入框外侧） */

    .app-search-modal__header{
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 20;
        background: #111;
        padding: 10px 12px;
        gap: 8px;
        box-shadow: 0 6px 12px rgba(0,0,0,.25);
    }
    .app-search-modal__dialog{
        background-image: none;
        background-color: #0f0f0f;
        padding-bottom: 0;
        padding-top: 50px;
    }
    .app-search-modal__body{
        overflow-y: auto;
        max-height: 80vh;
        padding-top: 0px;
    }
    .app-search-field{
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .app-search-content{
        flex-direction: column;
        padding-left: 0;
    }
    .app-search-right{
        flex: 0 0 auto;
        border-left: none;
        padding-left: 0;
        margin-top: 12px;
    }
    .app-search-close-btn{
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
    }
}