/* 搜索弹窗样式 */

/* 搜索弹窗基础样式 */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.search-modal-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.search-modal-container.show {
    transform: scale(1);
    opacity: 1;
}

.search-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-modal-input-wrapper {
    flex: 1;
    position: relative;
}

.search-modal-input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-modal-input-wrapper input:focus {
    border-color: var(--primary-color);
}

.search-modal-input-wrapper button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.search-modal-input-wrapper button:hover {
    background: var(--primary-dark);
}

.search-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s;
}

.search-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-modal-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.search-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.search-modal-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.search-modal-footer .btn-load {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-modal-footer .btn-load:hover {
    background: var(--primary-dark);
}

.search-modal-footer .btn-load:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* 搜索加载状态 */
.search-loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.search-loading i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.search-loading p {
    font-size: 16px;
}

/* 搜索空状态 */
.search-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.search-empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    color: #e0e0e0;
}

.search-empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.search-empty-state-hint {
    font-size: 14px !important;
    color: #ccc !important;
}

/* 搜索错误状态 */
.search-error-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.search-error-state i {
    font-size: 64px;
    margin-bottom: 16px;
    color: #ff6b6b;
}

.search-error-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

.search-retry-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-retry-btn:hover {
    background: var(--primary-dark);
}

/* 搜索结果卡片 */
.search-note-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.search-note-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
}

.search-note-content-wrapper {
    flex: 1;
    min-width: 0;
}

.search-note-media {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-note-images {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
}

.search-note-image {
    width: calc(50% - 2px);
    height: calc(50% - 2px);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.search-note-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-note-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-note-user-info {
    flex: 1;
}

.search-note-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.search-note-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.search-note-content {
    margin-bottom: 10px;
}

.search-note-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-note-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-note-media {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    position: relative;
}

.search-note-image {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.search-note-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.search-note-card:hover .search-note-image img {
    opacity: 1;
}

.search-note-video {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.search-video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
}

.search-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.search-note-card:hover .search-video-thumbnail img {
    opacity: 1;
}

.search-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-note-card:hover .search-video-play-btn {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.search-note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.search-note-stats {
    display: flex;
    gap: 16px;
}

.search-note-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.search-note-card:hover .search-note-stat {
    color: var(--text-primary);
}

.search-note-stat i {
    font-size: 14px;
}

.search-note-detail-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-note-detail-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

.search-note-detail-btn i {
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-modal-container {
        width: 95%;
        max-width: none;
        max-height: 95vh;
    }
    
    .search-modal-header {
        padding: 15px;
    }
    
    .search-modal-input-wrapper input {
        padding: 10px 36px 10px 14px;
        font-size: 14px;
    }
    
    .search-modal-input-wrapper button {
        width: 28px;
        height: 28px;
    }
    
    .search-modal-close {
        font-size: 20px;
    }
    
    .search-modal-content {
        padding: 15px;
        max-height: 50vh;
    }
    
    .search-modal-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .search-modal-footer {
        padding: 15px;
    }
    
    .search-note-card {
        padding: 15px;
        flex-direction: column;
        gap: 12px;
    }
    
    .search-note-media {
        width: 100%;
        height: 180px;
    }
    
    .search-note-title {
        font-size: 15px;
    }
    
    .search-note-text {
        font-size: 13px;
    }
    
    .search-note-footer {
        padding-top: 8px;
    }
    
    .search-note-stats {
        gap: 12px;
    }
    
    .search-note-stat {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .search-modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .search-modal-header {
        padding: 12px;
    }
    
    .search-modal-content {
        padding: 12px;
    }
    
    .search-modal-footer {
        padding: 12px;
    }
    
    .search-note-card {
        padding: 12px;
    }
    
    .search-note-media {
        height: 150px;
    }
    
    .search-note-title {
        font-size: 14px;
    }
    
    .search-note-text {
        font-size: 12px;
    }
    
    .search-loading,
    .search-empty-state,
    .search-error-state {
        padding: 40px 15px;
    }
    
    .search-loading i {
        font-size: 36px;
    }
    
    .search-empty-state i,
    .search-error-state i {
        font-size: 48px;
    }
}