/* 以图搜视频 - 前端搜索组件样式 */

.imgsearch-panel {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
}

.imgsearch-home {
    display: inline-block;
    margin-bottom: 15px;
    color: #2196f3;
    text-decoration: none;
    font-size: 13px;
}

.imgsearch-home:hover {
    text-decoration: underline;
}

.imgsearch-header h3 {
    font-size: 22px;
    color: #333;
    margin: 0 0 8px;
}

.imgsearch-subtitle {
    font-size: 13px;
    color: #999;
    margin: 0 0 20px;
}

/* 拖拽区域 */
.imgsearch-dropzone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.imgsearch-dropzone:hover,
.imgsearch-dropzone.dragover {
    border-color: #2196f3;
    background: #e3f2fd;
}

.dropzone-content p {
    margin: 10px 0 0;
    color: #666;
    font-size: 14px;
}

.dropzone-hint {
    font-size: 12px !important;
    color: #bbb !important;
}

/* 预览 */
.imgsearch-preview {
    text-align: center;
    padding: 20px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: #fff;
}

.imgsearch-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.imgsearch-btn-clear {
    display: block;
    margin: 12px auto 0;
    padding: 6px 16px;
    border: 1px solid #f44336;
    color: #f44336;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.imgsearch-btn-clear:hover {
    background: #f44336;
    color: #fff;
}

/* 状态提示 */
.imgsearch-status {
    padding: 10px 0;
    font-size: 13px;
    color: #999;
    min-height: 20px;
}

.imgsearch-status.info { color: #2196f3; }
.imgsearch-status.success { color: #4caf50; }
.imgsearch-status.error { color: #f44336; }

/* 搜索按钮 */
.imgsearch-btn-search {
    display: block;
    width: 200px;
    margin: 15px auto;
    padding: 12px 0;
    background: #2196f3;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.imgsearch-btn-search:hover {
    background: #1976d2;
}

.imgsearch-btn-search:disabled {
    background: #bbb;
    cursor: not-allowed;
}

/* 搜索结果网格 */
.imgsearch-result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .imgsearch-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.imgsearch-result-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.imgsearch-result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.result-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.result-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #f0f0f0;
}

.result-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-score {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(33, 150, 243, 0.9);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

.result-dimension {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.result-title {
    padding: 8px 10px;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.imgsearch-no-result {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

/* ==================== 弹窗模式 ==================== */
.imgsearch-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.imgsearch-modal {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
    animation: imgsearchModalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.imgsearch-modal .imgsearch-panel {
    max-width: 100%;
    padding: 32px 28px;
}

.imgsearch-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: all 0.25s ease;
}

.imgsearch-modal-close:hover {
    background: #f44336;
    color: #fff;
    transform: rotate(90deg);
}

@keyframes imgsearchModalIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .imgsearch-modal-overlay {
        padding: 0;
    }
    .imgsearch-modal {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .imgsearch-modal .imgsearch-panel {
        padding: 24px 16px;
    }
}
