/**
 * 吸顶搜索框样式
 * 适配全局主题
 */

/* 搜索框容器添加上边距（5vh） */
.search-box-container {
    margin-top: 5vh;
    transition: all 0.3s ease;
}

/* 吸顶模式 - 完全模仿顶部导航栏样式 */
.search-box-container.sticky-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    z-index: 100;
    animation: slideDown 0.3s ease;
}

/* 吸顶模式下的搜索框包装 - 与导航栏样式完全一致 */
.search-box-container.sticky-mode .search-box-wrapper {
    width: 100%;
    max-width: 100%;
    height: 4vh;
    min-height: 50px;
    padding: 0 24px;
    margin: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--bg-border);
    border-bottom: 1px solid var(--bg-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 隐藏分类标签 */
.search-box-container.sticky-mode .search-tabs {
    display: none !important;
}

/* 隐藏搜索引擎选项 */
.search-box-container.sticky-mode .search-engines {
    display: none !important;
}

/* 调整搜索输入框包装 */
.search-box-container.sticky-mode .search-input-wrapper {
    margin: 0;
    padding: 0;
    flex: 0 1 600px;
    max-width: 600px;
    position: static;
}

/* 调整搜索表单 */
.search-box-container.sticky-mode .search-form {
    gap: 8px;
    display: flex;
    align-items: center;
}

/* 调整搜索输入框 */
.search-box-container.sticky-mode .search-input {
    height: 32px;
    min-height: 32px;
    font-size: 13px;
    padding: 0 12px;
    flex: 1;
}

/* 调整搜索按钮 */
.search-box-container.sticky-mode .search-submit-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0;
}

.search-box-container.sticky-mode .search-submit-btn svg {
    width: 14px;
    height: 14px;
}

/* 吸顶时搜索建议的位置调整 */
.search-box-container.sticky-mode .search-suggestions {
    position: fixed;
    top: 4vh;
    min-top: 50px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: calc(100% - 48px);
    max-width: 600px;
    margin-top: 4px;
}

/* 顶部导航栏隐藏动画 */
.top-nav-bar {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.top-nav-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* 下滑动画 */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 为滚动内容留出空间 */
.layer-content {
    scroll-padding-top: 60px;
}

/* 响应式 */
@media (max-width: 768px) {
    .search-box-container {
        margin-top: 4vh;
    }

    .search-box-container.sticky-mode .search-box-wrapper {
        height: auto;
        min-height: 45px;
        padding: 8px 16px;
        gap: 8px;
    }

    .search-box-container.sticky-mode .search-input-wrapper {
        flex: 1;
        max-width: 100%;
    }

    .search-box-container.sticky-mode .search-input {
        height: 30px;
        min-height: 30px;
        font-size: 12px;
    }

    .search-box-container.sticky-mode .search-submit-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
    }

    .search-box-container.sticky-mode .search-submit-btn svg {
        width: 12px;
        height: 12px;
    }

    .search-box-container.sticky-mode .search-suggestions {
        width: calc(100% - 32px);
    }

    /* 内容层响应式内边距 */
    .search-box-container:not(.sticky-mode),
    .navigation-grid-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}
