/**
 * 通用样式
 * Toast 提示、加载动画等
 */

/* Toast 通知样式 */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification i {
    font-size: 18px;
}

.toast-success {
    color: #34c759;
    border-left: 4px solid #34c759;
}

.toast-error {
    color: #ff3b30;
    border-left: 4px solid #ff3b30;
}

.toast-info {
    color: #0a84ff;
    border-left: 4px solid #0a84ff;
}

.toast-warning {
    color: #ff9500;
    border-left: 4px solid #ff9500;
}

/* 暗黑模式下的 Toast */
[data-theme="dark"] .toast-notification {
    background: rgba(44, 44, 46, 0.95);
    color: #fff;
}

/* 高亮标记 */
.highlight {
    background-color: #ffeb3b;
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
}

[data-theme="dark"] .highlight {
    background-color: #ff9500;
    color: #fff;
}

/* 搜索历史下拉菜单 */
.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    backdrop-filter: blur(20px);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: -1px;
}

.search-history-dropdown.show {
    display: block;
}

.search-history-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-history-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #8e8e93;
    margin: 0;
}

.clear-history-btn {
    font-size: 12px;
    color: #ff3b30;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.clear-history-btn:hover {
    background: rgba(255, 59, 48, 0.1);
}

.search-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-history-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.search-history-item:last-child {
    border-bottom: none;
}

.search-history-item:hover {
    background: rgba(10, 132, 255, 0.05);
}

.search-history-item .icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.search-history-item .icon.drive {
    background: linear-gradient(135deg, #0a84ff, #0051d5);
}

.search-history-item .icon.video {
    background: linear-gradient(135deg, #ff3b30, #d70015);
}

.search-history-item .content {
    flex: 1;
    min-width: 0;
}

.search-history-item .keyword {
    font-size: 14px;
    font-weight: 500;
    color: #1c1c1e;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-history-item .time {
    font-size: 12px;
    color: #8e8e93;
}

.search-history-item .delete-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: none;
    border: none;
    color: #8e8e93;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
}

.search-history-item:hover .delete-btn {
    opacity: 1;
}

.search-history-item .delete-btn:hover {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.search-history-empty {
    padding: 40px 16px;
    text-align: center;
    color: #8e8e93;
    font-size: 14px;
}

.search-history-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* 暗黑模式下的搜索历史 */
[data-theme="dark"] .search-history-dropdown {
    background: rgba(44, 44, 46, 0.98);
}

[data-theme="dark"] .search-history-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .search-history-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .search-history-item:hover {
    background: rgba(10, 132, 255, 0.15);
}

[data-theme="dark"] .search-history-item .keyword {
    color: #fff;
}

/* 收藏按钮样式 */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #8e8e93;
    font-size: 18px;
    transition: all 0.2s;
    border-radius: 8px;
}

.favorite-btn:hover {
    background: rgba(255, 204, 0, 0.1);
    color: #ffcc00;
}

.favorite-btn.active {
    color: #ffcc00;
}

.favorite-btn.active i {
    animation: heartbeat 0.3s ease-in-out;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* 复制按钮样式 */
.copy-btn {
    background: rgba(10, 132, 255, 0.1);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    color: #0a84ff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:hover {
    background: rgba(10, 132, 255, 0.2);
}

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

.copy-btn i {
    font-size: 14px;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2c2c2e 25%, #3a3a3c 50%, #2c2c2e 75%);
    background-size: 200% 100%;
}

.skeleton-result {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8e8e93;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1c1c1e;
}

[data-theme="dark"] .empty-state h3 {
    color: #fff;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .toast-notification {
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(-100px);
        max-width: calc(100% - 32px);
    }

    .toast-notification.show {
        transform: translateX(0) translateY(0);
    }

    .search-history-dropdown {
        border-radius: 0 0 16px 16px;
    }
}


