/* 网盘资源搜索插件样式 */

/* ========== 小工具容器 ========== */
.nds-search-widget {
    margin-bottom: 20px;
}

/* ========== 搜索表单 ========== */
.nds-search-form {
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.nds-search-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.nds-search-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
    color: #333;
}

.nds-search-input:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.nds-search-input::placeholder {
    color: #999;
}

.nds-search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 16px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nds-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.nds-search-button:active {
    transform: translateY(0);
}

.nds-search-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 筛选选项 */
.nds-search-filters {
    display: flex;
    gap: 8px;
}

.nds-select {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 13px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.nds-select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* ========== 加载状态 ========== */
.nds-loading {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 12px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nds-loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: nds-spin 1s linear infinite;
}

@keyframes nds-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nds-loading p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* ========== 搜索结果 ========== */
.nds-search-results {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.nds-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 10px;
}

.nds-results-count {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.nds-close-results {
    background: #f5f5f5;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nds-close-results:hover {
    background: #667eea;
    color: white;
    transform: rotate(90deg);
}

.nds-results-content {
    max-height: 360px;
    overflow-y: auto;
}

.nds-result-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.25s;
    border: 1px solid transparent;
}

.nds-result-item:last-child {
    margin-bottom: 0;
}

.nds-result-item:hover {
    background: #f8f9ff;
    border-color: #e8ebff;
    transform: translateX(3px);
}

.nds-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    display: block;
    text-decoration: none;
    transition: color 0.3s;
}

.nds-result-title:hover {
    color: #667eea;
}

.nds-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.nds-result-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.nds-result-badge.local {
    background: #e8f5e9;
    color: #2e7d32;
}

.nds-result-badge.api {
    background: #e3f2fd;
    color: #1565c0;
}

.nds-result-badge.quark,
.nds-result-badge.夸克 {
    background: #fff3e0;
    color: #e65100;
}

.nds-result-badge.baidu,
.nds-result-badge.百度 {
    background: #e8eaf6;
    color: #3f51b5;
}

.nds-result-badge.xunlei,
.nds-result-badge.迅雷 {
    background: #fce4ec;
    color: #c2185b;
}

.nds-result-excerpt {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.nds-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.nds-no-results svg {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.nds-no-results p {
    margin: 0;
    font-size: 14px;
}

/* ========== 最近记录 ========== */
.nds-recent-records {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nds-recent-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.nds-recent-list {
    max-height: 300px;
    overflow-y: auto;
}

.nds-recent-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

.nds-recent-item {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid transparent;
}

.nds-recent-item:last-child {
    margin-bottom: 0;
}

.nds-recent-item:hover {
    background: #f8f9ff;
    border-color: #e8ebff;
    transform: translateX(3px);
}

.nds-recent-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.nds-recent-item:hover .nds-recent-item-title {
    color: #667eea;
}

.nds-recent-item-meta {
    font-size: 11px;
    color: #999;
    display: flex;
    gap: 12px;
    align-items: center;
}

.nds-recent-empty {
    text-align: center;
    padding: 32px 16px;
    color: #999;
}

.nds-recent-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    opacity: 0.3;
    color: #667eea;
}

.nds-recent-empty p {
    font-size: 13px;
    margin: 0;
}

/* ========== 二维码模态框 ========== */
#nds-qrcode-modal.nds-qrcode-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.75) !important;
    z-index: 99999 !important;
    overflow: auto !important;
}

#nds-qrcode-modal.nds-qrcode-modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#nds-qrcode-modal .nds-modal-content {
    background: white !important;
    border-radius: 20px !important;
    padding: 40px !important;
    max-width: 500px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: relative !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: nds-slideUp 0.4s ease-out !important;
    margin: auto !important;
}

@keyframes nds-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#nds-qrcode-modal .nds-modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: none !important;
    border: none !important;
    font-size: 28px !important;
    color: #999 !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.3s !important;
    line-height: 1 !important;
}

#nds-qrcode-modal .nds-modal-close:hover {
    background: #f0f0f0 !important;
    color: #333 !important;
}

#nds-qrcode-modal .nds-modal-icon {
    font-size: 60px !important;
    text-align: center !important;
    margin-bottom: 20px !important;
}

#nds-qrcode-modal .nds-modal-title {
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    text-align: center !important;
    margin: 0 0 10px 0 !important;
    word-break: break-word !important;
}

#nds-qrcode-modal .nds-modal-subtitle {
    font-size: 14px !important;
    color: #718096 !important;
    text-align: center !important;
    margin: 0 0 30px 0 !important;
}

#nds-qrcode-modal .nds-qrcode-wrapper {
    background: #f7fafc !important;
    border-radius: 15px !important;
    padding: 30px !important;
    text-align: center !important;
    margin-bottom: 20px !important;
}

#nds-qrcode-modal .nds-qrcode-inner {
    background: white !important;
    padding: 20px !important;
    border-radius: 10px !important;
    display: inline-block !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

#nds-qrcode-modal #nds-modal-qrcode {
    margin: 0 auto !important;
    min-height: 200px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#nds-qrcode-modal .nds-qrcode-hint {
    margin-top: 15px !important;
    margin-bottom: 0 !important;
    font-size: 14px !important;
    color: #4a5568 !important;
}

#nds-qrcode-modal .nds-modal-loading {
    text-align: center !important;
    padding: 40px 20px !important;
}

#nds-qrcode-modal .nds-modal-loading-spinner {
    width: 50px !important;
    height: 50px !important;
    margin: 0 auto 20px !important;
    border: 4px solid #f3f3f3 !important;
    border-top: 4px solid #667eea !important;
    border-radius: 50% !important;
    animation: nds-spin 1s linear infinite !important;
}

#nds-qrcode-modal .nds-modal-loading-text {
    font-size: 16px !important;
    color: #666 !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

#nds-qrcode-modal .nds-modal-footer {
    margin-top: 20px !important;
    text-align: center !important;
}

#nds-qrcode-modal .nds-modal-btn {
    padding: 12px 30px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
}

#nds-qrcode-modal .nds-modal-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3) !important;
}

#nds-qrcode-modal .nds-modal-btn:active {
    transform: translateY(0) !important;
}

/* ========== 响应式设计 ========== */
@media (max-width: 600px) {
    #nds-qrcode-modal .nds-modal-content {
        padding: 30px 20px !important;
        width: 95% !important;
    }

    #nds-qrcode-modal .nds-modal-title {
        font-size: 20px !important;
    }

    #nds-qrcode-modal .nds-modal-icon {
        font-size: 50px !important;
    }

    #nds-qrcode-modal .nds-qrcode-wrapper {
        padding: 20px !important;
    }
}

/* ========== 滚动条美化 ========== */
.nds-recent-list::-webkit-scrollbar,
.nds-results-content::-webkit-scrollbar {
    width: 6px;
}

.nds-recent-list::-webkit-scrollbar-track,
.nds-results-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.nds-recent-list::-webkit-scrollbar-thumb,
.nds-results-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.nds-recent-list::-webkit-scrollbar-thumb:hover,
.nds-results-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* ========== 主题适配 ========== */
.widget .nds-search-widget {
    padding: 0;
}

.sidebar .nds-search-input,
.sidebar .nds-select {
    font-size: 13px;
}

/* ========== 登录提示 ========== */
.nds-login-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    text-align: center;
}

.nds-login-notice p {
    margin: 0;
    font-size: 13px;
    color: #856404;
}

.nds-login-notice a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.nds-login-notice a:hover {
    text-decoration: underline;
}

/* ========== 使用次数提示 ========== */
.nds-usage-hint {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 10px;
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: #2e7d32;
    font-weight: 500;
}

.nds-usage-hint.warning {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.nds-usage-hint.danger {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}
