/* 图片搜索模块样式 */
.image-search-container {
    background: linear-gradient(135deg, #a78bfa 0%, #c084fc 100%);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.2);
    margin: 0;
    position: relative;
    overflow: hidden;
}

.image-search-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.image-search-title {
    font-size: 28px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.image-search-title i {
    color: #fbbf24;
    font-size: 32px;
}

.image-search-description {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    line-height: 1.8;
    font-size: 16px;
    position: relative;
    z-index: 1;
}

/* 左右分栏布局 */
.upload-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .upload-layout {
        grid-template-columns: 1fr;
    }
}

.image-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.image-upload-area:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.image-upload-area.dragover {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    transform: scale(1.01);
}

/* Pro Tip 区域 */
.pro-tip-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 300px;
}

.pro-tip-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #7c3aed;
    margin-bottom: 10px;
}

.pro-tip-title i {
    font-size: 22px;
    color: #fbbf24;
}

.pro-tip-content {
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 4px;
}

.pro-tip-example {
    margin-top: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.pro-tip-example-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
}

.pro-tip-example-header i {
    font-size: 16px;
}

.pro-tip-example-images {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    padding: 4px;
    overflow-x: auto;
}

.pro-tip-image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
}

.pro-tip-image-item img {
    max-width: 70px;
    max-height: 140px;
    height: auto;
    width: auto;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.pro-tip-image-item:hover img {
    border-color: #8b5cf6;
    transform: scale(1.05);
}

.pro-tip-image-label {
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
}

.pro-tip-image-label.bad {
    background: #fee2e2;
    color: #dc2626;
}

.pro-tip-image-label.medium {
    background: #fef3c7;
    color: #d97706;
}

.pro-tip-image-label.good {
    background: #d1fae5;
    color: #059669;
}

/* 响应式 */
@media (max-width: 768px) {
    .pro-tip-area {
        max-width: 100%;
    }
    
    .pro-tip-example-images {
        justify-content: space-around;
        gap: 12px;
    }
    
    .pro-tip-image-item img {
        max-width: 90px;
        max-height: 180px;
    }
    
    .pro-tip-image-label {
        font-size: 10px;
        padding: 4px 10px;
    }
}

.pro-tip-example img {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 8px;
}

.upload-icon {
    font-size: 48px;
    color: white;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.upload-text {
    font-size: 18px;
    color: white;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.image-preview-container {
    display: none;
    position: relative;
    z-index: 1;
}

.image-preview-container.active {
    display: block;
}

.preview-image {
    max-width: 200px;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: block;
    margin: 0 auto;
}

.search-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* 镂空搜索按钮 - Icon Only */
.btn-search-icon {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-search-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.btn-search-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 镂空长条按钮样式 */
.btn-search-long {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: white;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 300px;
}

.btn-search-long i {
    font-size: 18px;
}

.btn-search-long:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.btn-search-long:active {
    transform: translateY(0);
}

.btn-search-long:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 搜索进度条样式 */
.search-progress-container {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.search-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.search-progress-bar {
    flex: 1;
    max-width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.search-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: progressShine 1.5s linear infinite;
}

@keyframes progressShine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.search-progress-percent {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    min-width: 40px;
    text-align: right;
}

.search-results {
    margin-top: 40px;
    display: none;
    position: relative;
    z-index: 1;
}

.search-results.active {
    display: block;
}

.results-header {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid rgba(251, 191, 36, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-header i {
    color: #fbbf24;
}

.results-stats {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-left: 4px solid #fbbf24;
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    font-size: 15px;
    color: white;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.no-results i {
    font-size: 80px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.3);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    max-width: 100%;
    overflow-x: hidden;
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
}

/* 图片容器 - 固定宽高比 */
.result-image-wrapper {
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.result-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.result-level {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-level i {
    color: #667eea;
    font-size: 14px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.result-card:hover .result-level i {
    opacity: 1;
    transform: translateX(3px);
}

.result-similarity {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}


.error-message {
    background: rgba(254, 226, 226, 0.95);
    border: 2px solid #fca5a5;
    color: #991b1b;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    position: relative;
    z-index: 1;
}

.error-message.active {
    display: block;
}

.error-message i {
    margin-right: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-search-container {
        padding: 25px;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .result-level {
        font-size: 14px;
    }
    
    .results-header {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-search-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .result-level {
        font-size: 13px;
    }
    
    .results-header {
        font-size: 18px;
    }
}
