/* 头部固定定位和搜索按钮样式 */
.srf-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
}
/* 内容区避免被固定导航栏遮挡 */
.srf-content, .site-content, main {
    padding-top: 60px !important;
}
.srf-topbar-search-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 5px;
}
.srf-topbar-search-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}
.srf-topbar-search-btn .srf-topbar-icon {
    font-size: 16px;
}
@media (max-width: 480px) {
    .srf-topbar-search-btn {
        width: 32px;
        height: 32px;
    }
    .srf-topbar-search-btn .srf-topbar-icon {
        font-size: 14px;
    }
}

/* 搜索遮罩层样式 */
.srf-search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    background: rgba(0,0,0,0.7);
    @supports (backdrop-filter: blur(8px)) {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        background: rgba(0,0,0,0.6);
    }
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 15px 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.srf-search-overlay.show {
    opacity: 1;
    visibility: visible;
}
.srf-search-box {
    width: 100%;
    max-width: 560px;
    background: linear-gradient(135deg, var(--srf-search-bg1, #667eea) 0%, var(--srf-search-bg2, #764ba2) 100%);
    border-radius: 20px;
    padding: 28px 22px 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    transform: translateY(-30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    flex-shrink: 0;
}
.srf-search-overlay.show .srf-search-box {
    transform: translateY(0) scale(1);
}
.srf-search-box::before {
    content: '';
    position: absolute;
    top: -50%; right: -30%;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: srfSearchFloat 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes srfSearchFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
.srf-search-close {
    position: absolute;
    top: 10px; right: 12px;
    width: 30px; height: 30px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
    flex-shrink: 0;
}
.srf-search-close:hover {
    background: rgba(255,255,255,0.35);
    transform: rotate(90deg);
}
.srf-search-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 4px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    word-break: break-word;
    line-height: 1.3;
}
.srf-search-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    text-align: center;
    margin: 0 0 18px;
    position: relative;
    z-index: 1;
    word-break: break-word;
    line-height: 1.4;
}
.srf-search-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    padding: 5px 5px 5px 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    min-width: 0;
}
.srf-search-input-wrap:focus-within {
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}
.srf-search-icon {
    font-size: 15px;
    margin-right: 8px;
    flex-shrink: 0;
}
.srf-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    background: transparent;
    color: #333;
    min-width: 0;
    width: 100%;
}
.srf-search-input::placeholder { color: #aaa; }
.srf-search-submit {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245,87,108,0.4);
    white-space: nowrap;
}
.srf-search-submit:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(245,87,108,0.5);
}
.srf-search-submit:active {
    transform: scale(0.98);
}
.srf-search-keywords-label {
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}
.srf-search-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
    z-index: 1;
}
.srf-search-keyword-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.3s ease;
    @supports (backdrop-filter: blur(10px)) {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
}
.srf-search-keyword-tag:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-2px);
}

/* 平板适配 */
@media (min-width: 601px) and (max-width: 900px) {
    .srf-search-overlay { padding: 70px 20px 30px; }
    .srf-search-box { max-width: 500px; padding: 30px 25px 26px; }
    .srf-search-title { font-size: 23px; }
}

/* 大屏适配 */
@media (min-width: 901px) {
    .srf-search-overlay { padding: 100px 20px 40px; }
    .srf-search-box { max-width: 560px; padding: 35px 30px 30px; border-radius: 24px; }
    .srf-search-title { font-size: 26px; }
    .srf-search-subtitle { font-size: 14px; margin-bottom: 22px; }
    .srf-search-input-wrap { padding: 7px 7px 7px 20px; margin-bottom: 20px; }
    .srf-search-input { font-size: 15px; padding: 10px 0; }
    .srf-search-submit { padding: 10px 26px; font-size: 14px; }
    .srf-search-keyword-tag { padding: 5px 14px; font-size: 12px; }
    .srf-search-close { width: 34px; height: 34px; font-size: 18px; top: 14px; right: 16px; }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    .srf-search-overlay { padding: 50px 10px 15px; }
    .srf-search-box { padding: 24px 16px 20px; border-radius: 18px; }
    .srf-search-title { font-size: 19px; margin-bottom: 3px; }
    .srf-search-subtitle { font-size: 12px; margin-bottom: 15px; }
    .srf-search-input-wrap { padding: 4px 4px 4px 14px; margin-bottom: 14px; }
    .srf-search-icon { font-size: 14px; margin-right: 6px; }
    .srf-search-input { font-size: 13px; padding: 7px 0; }
    .srf-search-submit { padding: 7px 16px; font-size: 12px; }
    .srf-search-keyword-tag { padding: 3px 10px; font-size: 10px; }
    .srf-search-close { width: 28px; height: 28px; font-size: 14px; top: 8px; right: 10px; }
    .srf-search-box::before { width: 200px; height: 200px; }
}

/* 超小屏适配 */
@media (max-width: 360px) {
    .srf-search-overlay { padding: 45px 8px 12px; }
    .srf-search-box { padding: 22px 14px 18px; border-radius: 16px; }
    .srf-search-title { font-size: 17px; }
    .srf-search-subtitle { font-size: 11px; }
    .srf-search-input-wrap { padding: 4px 4px 4px 12px; }
    .srf-search-icon { font-size: 13px; margin-right: 5px; }
    .srf-search-input { font-size: 12px; padding: 6px 0; }
    .srf-search-submit { padding: 6px 14px; font-size: 11px; }
    .srf-search-keyword-tag { padding: 3px 9px; font-size: 10px; }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .srf-search-overlay { padding: 20px 15px; align-items: center; }
    .srf-search-box { max-width: 500px; padding: 20px 22px; }
    .srf-search-title { font-size: 18px; margin-bottom: 2px; }
    .srf-search-subtitle { font-size: 12px; margin-bottom: 12px; }
    .srf-search-input-wrap { margin-bottom: 12px; }
}
