/* 
 * 按钮样式优化 - 搜索按钮和返回顶部按钮
 * 简洁大气，与网站整体风格保持一致
 */

/* ===== 搜索按钮优化 ===== */
.search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 30px;
    padding: 4px;
    border: 2px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.search-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.search-form:focus-within {
    border-color: #007bff;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.15);
    transform: translateY(-1px);
}

.search-form:focus-within::before {
    left: 100%;
}

.search-input {
    border: none;
    background: transparent;
    padding: 12px 20px;
    font-size: 15px;
    outline: none;
    width: 300px;
    color: #333;
    font-weight: 400;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-input:focus::placeholder {
    color: #bbb;
    transform: translateX(5px);
}

.search-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
    padding: 12px 18px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.search-btn:hover::before {
    left: 100%;
}

.search-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.search-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.search-btn:hover i {
    transform: scale(1.1);
}

/* 搜索按钮文字版本 */
.search-btn-text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== 返回顶部按钮优化 ===== */
.back-to-top {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 56px !important;
    height: 56px !important;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: none !important;
    z-index: 1000 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.back-to-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 0 8px 30px rgba(0, 123, 255, 0.4) !important;
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%) !important;
}

.back-to-top:hover::before {
    opacity: 1;
}

.back-to-top:active {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.35) !important;
}

/* 返回顶部按钮动画效果 */
@keyframes backToTopShow {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes backToTopHide {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
}

.back-to-top.show {
    display: block !important;
    animation: backToTopShow 0.3s ease-out;
}

.back-to-top.hide {
    animation: backToTopHide 0.3s ease-out;
}

/* 返回顶部按钮图标 */
.back-to-top .icon {
    transition: transform 0.3s ease;
}

.back-to-top:hover .icon {
    transform: translateY(-2px);
}

/* ===== 搜索页面专用样式 ===== */
.search-form-main {
    margin-bottom: 25px;
}

.search-input-group {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-group:focus-within {
    border-color: #007bff;
    box-shadow: 0 6px 30px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.search-input-group input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: #333;
}

.search-input-group input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-input-group .search-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 16px 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
    min-width: 100px;
}

.search-input-group .search-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    transform: scale(1.02);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .search-form {
        border-radius: 25px;
        padding: 3px;
    }
    
    .search-input {
        width: 200px;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .search-btn {
        padding: 10px 14px;
        font-size: 14px;
        min-width: 70px;
    }
    
    .back-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 18px !important;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: 20px;
        max-width: 100%;
    }
    
    .search-input-group input {
        padding: 14px 20px;
        border-radius: 20px 20px 0 0;
    }
    
    .search-input-group .search-btn {
        border-radius: 0 0 20px 20px;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .search-input {
        width: 160px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 60px;
    }
    
    .back-to-top {
        bottom: 15px !important;
        right: 15px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 16px !important;
    }
    
    .search-input-group input {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .search-input-group .search-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* ===== 暗色模式支持 ===== */
@media (prefers-color-scheme: dark) {
    .search-form {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .search-input {
        color: #e2e8f0;
    }
    
    .search-input::placeholder {
        color: #a0aec0;
    }
    
    .search-input-group {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .search-input-group input {
        color: #e2e8f0;
    }
    
    .search-input-group input::placeholder {
        color: #a0aec0;
    }
}

/* ===== 动画增强 ===== */
@keyframes searchPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.search-btn:focus {
    animation: searchPulse 1.5s infinite;
}

@keyframes topBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

.back-to-top:focus {
    animation: topBounce 1s ease-in-out;
}

/* ===== 无障碍支持 ===== */
.search-btn:focus-visible,
.back-to-top:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .search-form,
    .search-btn,
    .back-to-top,
    .search-input-group {
        transition: none;
    }
    
    .search-form::before,
    .search-btn::before,
    .back-to-top::before {
        display: none;
    }
    
    .search-btn:focus,
    .back-to-top:focus {
        animation: none;
    }
} 