/* 以图搜图按钮 - 搜索框内部图标样式 */
.GanLuPic-image-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-right: 8px;
    flex-shrink: 0;
}

.GanLuPic-image-search-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
}

.GanLuPic-image-search-btn:active {
    transform: scale(0.95);
}

.GanLuPic-image-search-btn-icon {
    width: 18px;
    height: 18px;
}

.GanLuPic-image-search-btn-text {
    display: none;
}

/* 首页 Banner 搜索框（白色背景） */
.home-banner-search .GanLuPic-image-search-btn {
    color: rgba(0, 0, 0, 0.45);
    margin-right: 4px;
    position: relative;
}

.home-banner-search .GanLuPic-image-search-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.75);
}

/* 顶部导航栏搜索框（浅色背景） */
.pk-topbar-search-form .GanLuPic-image-search-btn {
    color: rgba(0, 0, 0, 0.45);
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0;
    z-index: 3;
}

.pk-topbar-search-form .GanLuPic-image-search-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.75);
}

/* 暗色模式下顶部导航栏 */
.dark .pk-topbar-search-form .GanLuPic-image-search-btn {
    color: rgba(255, 255, 255, 0.6);
}

.dark .pk-topbar-search-form .GanLuPic-image-search-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

/* 移动端搜索面板 */
.pk-mobile-search-form .GanLuPic-image-search-btn {
    color: rgba(0, 0, 0, 0.5);
    width: 32px;
    height: 32px;
    margin-right: 6px;
}

.pk-mobile-search-form .GanLuPic-image-search-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.75);
}

/* 移动端下拉搜索面板适配 */
.pk-mobile-search-form {
    position: relative;
}

.pk-mobile-search-form .GanLuPic-image-search-btn {
    position: absolute;
    right: 46px;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0;
}

@media (max-width: 768px) {
    .GanLuPic-image-search-btn {
        width: 32px;
        height: 32px;
        margin-right: 4px;
    }

    .GanLuPic-image-search-btn-icon {
        width: 16px;
        height: 16px;
    }

    /* 移动端 Banner 搜索框适配 */
    .home-banner-search {
        overflow: visible !important;
    }

    .home-banner-search .GanLuPic-image-search-btn {
        position: relative;
        flex-shrink: 0;
    }

    .home-banner-search-input-wrapper input {
        padding-right: 80px !important;
    }

    /* 移动端顶部导航栏搜索框适配 */
    .pk-topbar-search-form .GanLuPic-image-search-btn {
        right: 64px;
    }
}

/* 顶部导航栏搜索框输入区域适配 */
.pk-topbar-search-input {
    padding-right: 100px !important;
}

.GanLuPic-image-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    overflow-y: auto;
}

.GanLuPic-image-search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: GanLuPic-modal-fade-in 0.3s ease;
}

.GanLuPic-image-search-modal-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 40px auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    animation: GanLuPic-modal-slide-up 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 移动端弹窗适配 */
@media (max-width: 768px) {
    .GanLuPic-image-search-modal {
        display: flex;
        align-items: flex-end;
        padding-top: env(safe-area-inset-top);
    }

    .GanLuPic-image-search-modal-overlay {
        background: rgba(0, 0, 0, 0.5);
    }

    .GanLuPic-image-search-modal-container {
        margin: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        animation: GanLuPic-modal-slide-up-mobile 0.35s ease;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        box-sizing: border-box;
    }

    @keyframes GanLuPic-modal-slide-up-mobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .GanLuPic-image-search-modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        border-bottom: 1px solid #e5e7eb;
    }

    .GanLuPic-image-search-modal-title {
        font-size: 16px;
    }

    .GanLuPic-image-search-modal-close {
        width: 28px;
        height: 28px;
    }

    .GanLuPic-image-search-modal-body {
        padding: 16px 20px 24px;
    }

    .GanLuPic-image-search-upload-dropzone {
        padding: 24px 16px;
    }

    .GanLuPic-image-search-upload-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .GanLuPic-image-search-upload-hint {
        font-size: 14px;
    }

    .GanLuPic-image-search-upload-formats {
        font-size: 12px;
    }

    .GanLuPic-image-search-preview-img {
        max-height: 200px;
    }

    .GanLuPic-image-search-results-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .GanLuPic-image-search-result-img {
        height: 100px;
    }

    .GanLuPic-image-search-result-info {
        padding: 8px 10px;
    }

    .GanLuPic-image-search-result-title {
        font-size: 12px;
    }

    .GanLuPic-image-search-result-meta {
        font-size: 11px;
    }

    .GanLuPic-image-search-loading {
        padding: 24px 16px;
    }

    .GanLuPic-image-search-loading-spinner {
        width: 36px;
        height: 36px;
    }

    .GanLuPic-image-search-results-empty {
        padding: 24px 16px;
    }

    .GanLuPic-image-search-results-empty svg {
        width: 48px;
        height: 48px;
    }

    .GanLuPic-image-search-results-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .GanLuPic-image-search-reupload-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* 小屏幕手机 */
@media (max-width: 480px) {
    .GanLuPic-image-search-modal-container {
        max-height: 92vh;
    }

    .GanLuPic-image-search-modal-header {
        padding: 14px 16px;
    }

    .GanLuPic-image-search-modal-body {
        padding: 14px 16px 20px;
    }

    .GanLuPic-image-search-upload-dropzone {
        padding: 20px 12px;
    }

    .GanLuPic-image-search-results-list {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .GanLuPic-image-search-result-img {
        height: 90px;
    }
}

@keyframes GanLuPic-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes GanLuPic-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.GanLuPic-image-search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.GanLuPic-image-search-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.GanLuPic-image-search-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.GanLuPic-image-search-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.GanLuPic-image-search-modal-close svg {
    width: 18px;
    height: 18px;
}

.GanLuPic-image-search-modal-body {
    padding: 24px;
}

.GanLuPic-image-search-upload-area {
    text-align: center;
}

.GanLuPic-image-search-upload-dropzone {
    position: relative;
    padding: 40px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.GanLuPic-image-search-upload-dropzone:hover {
    border-color: #6366f1;
    background: #f0f1ff;
}

.GanLuPic-image-search-upload-dropzone.dragover {
    border-color: #6366f1;
    background: #f0f1ff;
    transform: scale(1.02);
}

.GanLuPic-image-search-upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #9ca3af;
    transition: color 0.3s ease;
}

.GanLuPic-image-search-upload-dropzone:hover .GanLuPic-image-search-upload-icon,
.GanLuPic-image-search-upload-dropzone.dragover .GanLuPic-image-search-upload-icon {
    color: #6366f1;
}

.GanLuPic-image-search-upload-icon svg {
    width: 100%;
    height: 100%;
}

.GanLuPic-image-search-upload-hint {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

.GanLuPic-image-search-upload-formats {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.GanLuPic-image-search-upload-size {
    margin-left: 8px;
    padding: 2px 8px;
    background: #e5e7eb;
    border-radius: 4px;
    font-size: 12px;
}

.GanLuPic-image-search-preview {
    position: relative;
    margin-top: 20px;
}

.GanLuPic-image-search-preview-img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.GanLuPic-image-search-preview-remove {
    position: absolute;
    top: -12px;
    right: -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.GanLuPic-image-search-preview-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.GanLuPic-image-search-preview-remove svg {
    width: 14px;
    height: 14px;
}

.GanLuPic-image-search-submit-btn {
    margin-top: 20px;
}

.GanLuPic-image-search-loading {
    text-align: center;
    padding: 40px 20px;
}

.GanLuPic-image-search-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: GanLuPic-spinner 1s linear infinite;
}

@keyframes GanLuPic-spinner {
    to { transform: rotate(360deg); }
}

.GanLuPic-image-search-loading-text {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.GanLuPic-image-search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.GanLuPic-image-search-results-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.GanLuPic-image-search-reupload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.GanLuPic-image-search-reupload-btn:hover {
    background: #e5e7eb;
}

.GanLuPic-image-search-reupload-btn svg {
    width: 14px;
    height: 14px;
}

.GanLuPic-image-search-results-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .GanLuPic-image-search-results-list {
        grid-template-columns: 1fr;
    }
}

.GanLuPic-image-search-result-item {
    position: relative;
    background: #f9fafb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.GanLuPic-image-search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.GanLuPic-image-search-result-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.GanLuPic-image-search-result-info {
    padding: 10px 12px;
}

.GanLuPic-image-search-result-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.GanLuPic-image-search-result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
}

.GanLuPic-image-search-result-similarity {
    padding: 2px 6px;
    background: #dbeafe;
    border-radius: 4px;
    color: #2563eb;
    font-weight: 500;
}

.GanLuPic-image-search-results-empty {
    text-align: center;
    padding: 40px 20px;
}

.GanLuPic-image-search-results-empty svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #d1d5db;
}

.GanLuPic-image-search-results-empty p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.GanLuPic-image-search-load-more-btn {
    display: block;
    width: 100%;
    margin-top: 20px;
}

.GanLuPic-image-search-btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.GanLuPic-image-search-btn-group .GanLuPic-image-search-btn {
    flex-shrink: 0;
}