/* 参考来源预览样式 - 浅色主题 */

/* 来源容器 - 保持原样式 */
.sources-info {
    margin-top: 16px !important;
    padding: 12px 16px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.sources-title {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #666 !important;
    margin-bottom: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.sources-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

/* 来源项 - 保持原来的简洁样式 */
.source-item {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 16px !important;
    font-size: 12px !important;
    color: #666 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 1 !important;
    margin: 0 !important;
    margin-right: 0 !important;
}

.source-item:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15) !important;
    transform: translateY(-1px) !important;
    z-index: 1001 !important;
}

.source-name {
    font-weight: 400 !important;
}

.source-similarity {
    display: none !important;
}

/* 悬浮预览弹窗 - 浅色主题 */
.source-preview-popup {
    position: absolute !important;
    bottom: calc(100% + 12px) !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(10px) !important;
    width: 340px !important;
    max-width: 90vw !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    padding: 16px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* 防止最左侧卡片被遮挡 */
.source-item:first-child .source-preview-popup {
    left: 0 !important;
    transform: translateX(0) translateY(10px) !important;
}

.source-item:first-child:hover .source-preview-popup {
    transform: translateX(0) translateY(0) !important;
}

/* 防止最右侧卡片超出屏幕 */
.source-item:last-child .source-preview-popup {
    left: auto !important;
    right: 0 !important;
    transform: translateX(0) translateY(10px) !important;
}

.source-item:last-child:hover .source-preview-popup {
    transform: translateX(0) translateY(0) !important;
}

.source-preview-popup::before {
    content: '' !important;
    position: absolute !important;
    bottom: -6px !important;
    left: 50% !important;
    transform: translateX(-50%) rotate(45deg) !important;
    width: 12px !important;
    height: 12px !important;
    background: white !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* 第一个和最后一个元素的箭头位置调整 */
.source-item:first-child .source-preview-popup::before {
    left: 24px !important;
    transform: translateX(0) rotate(45deg) !important;
}

.source-item:last-child .source-preview-popup::before {
    left: auto !important;
    right: 24px !important;
    transform: translateX(0) rotate(45deg) !important;
}

.source-item:hover .source-preview-popup {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.preview-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.preview-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    line-height: 1.4 !important;
    flex: 1 !important;
}

.preview-similarity {
    display: none !important;
}

.preview-content {
    font-size: 12px !important;
    line-height: 1.6 !important;
    color: #4a5568 !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    margin-bottom: 12px !important;
    padding-right: 4px !important;
}

.preview-content::-webkit-scrollbar {
    width: 4px !important;
}

.preview-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 2px !important;
}

.preview-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 2px !important;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

.preview-footer {
    font-size: 11px !important;
    color: #718096 !important;
    text-align: center !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    font-style: italic !important;
}

/* 模态框样式 - 浅色主题 */
.source-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    padding: 20px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.source-modal-overlay.active {
    opacity: 1 !important;
}

.source-modal {
    background: white !important;
    border-radius: 16px !important;
    width: 100% !important;
    max-width: 700px !important;
    max-height: 80vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    transform: scale(0.9) translateY(20px) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.source-modal-overlay.active .source-modal {
    transform: scale(1) translateY(0) !important;
}

.source-modal-header {
    padding: 24px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
}

.source-modal-title {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    flex: 1 !important;
}

.source-modal-icon {
    font-size: 24px !important;
}

.source-modal-meta {
    display: none !important;
}

.source-modal-similarity {
    display: none !important;
}

.source-modal-close {
    width: 32px !important;
    height: 32px !important;
    border: none !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}

.source-modal-close:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    transform: rotate(90deg) !important;
}

.source-modal-close svg {
    width: 18px !important;
    height: 18px !important;
    color: #4a5568 !important;
}

.source-modal-content {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 24px !important;
}

.source-content-text {
    font-size: 14px !important;
    line-height: 1.8 !important;
    color: #4a5568 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

.source-modal-content::-webkit-scrollbar {
    width: 8px !important;
}

.source-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05) !important;
}

.source-modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 4px !important;
}

.source-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

.source-modal-footer {
    padding: 16px 24px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    display: flex !important;
    justify-content: flex-end !important;
}

.source-modal-copy-btn {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 20px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.source-modal-copy-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.source-modal-copy-btn svg {
    width: 16px !important;
    height: 16px !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .source-preview-popup {
        width: 280px !important;
        bottom: calc(100% + 8px) !important;
    }
    
    .source-modal {
        max-height: 90vh !important;
        border-radius: 12px !important;
    }
    
    .source-modal-header {
        padding: 20px !important;
    }
    
    .source-modal-title {
        font-size: 16px !important;
    }
    
    .source-modal-content {
        padding: 20px !important;
    }
    
    .source-content-text {
        font-size: 13px !important;
    }
}
