/* css/reference-manager-base.css */
/* 参考文献管理器基础样式 - 模态框、工具栏、表格 */

/* 模态框基础样式 */
.reference-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reference-modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.reference-edit-content {
    max-width: 800px;
}

/* 头部样式 */
.reference-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.reference-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reference-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.reference-modal-close:hover {
    color: #333;
    background-color: #f0f0f0;
}

/* 工具栏样式 */
.reference-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.reference-toolbar-left,
.reference-toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ref-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ref-btn:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.ref-btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.ref-btn-primary:hover {
    background-color: #2563eb;
}

.ref-btn-success {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.ref-btn-success:hover {
    background-color: #059669;
    border-color: #059669;
}

.ref-btn-danger {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

.ref-btn-danger:hover {
    background-color: #da190b;
}

.ref-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#ref-search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 250px;
    font-size: 14px;
}

#ref-filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* 统计信息样式 */
.reference-stats {
    display: flex;
    gap: 30px;
    padding: 15px 30px;
    background-color: #f0f4f8;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #555;
}

.reference-stats strong {
    color: #333;
    font-weight: 600;
}

/* 表格容器样式 */
.reference-table-container {
    flex: 1;
    overflow: auto;
    padding: 0;
}

/* 表格样式 */
.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.reference-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #fff;
}

.reference-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.reference-table th:hover {
    background-color: #f5f5f5;
}

.reference-table th[data-sort]::after {
    content: ' ⇅';
    opacity: 0.3;
}

.reference-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reference-table tbody tr:hover {
    background-color: #f8f9fa;
}

.ref-empty-state {
    text-align: center;
    color: #999;
    padding: 40px !important;
    font-style: italic;
}

/* 表格特定列样式 */
.ref-authors,
.ref-title,
.ref-journal {
    max-width: 200px;
}

.ref-title {
    font-weight: 500;
}

.ref-doi {
    color: #2196F3;
    text-decoration: none;
}

.ref-doi:hover {
    text-decoration: underline;
}

.ref-tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 4px;
}

.ref-actions {
    display: flex;
    gap: 8px;
}

.ref-action-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.ref-action-btn:hover {
    background-color: #e0e0e0;
}

/* 复选框样式 */
.ref-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* 底部样式 */
.reference-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.reference-footer-left {
    font-size: 14px;
    color: #666;
}

.reference-footer-right {
    display: flex;
    gap: 10px;
}

/* 编辑表单样式 */
.reference-edit-form {
    padding: 20px 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.ref-form-row {
    margin-bottom: 20px;
}

.ref-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.ref-form-row input,
.ref-form-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ref-form-row input:focus,
.ref-form-row select:focus {
    outline: none;
    border-color: #3b82f6;
}

.ref-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 进度提示样式 */
.ref-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

.ref-progress-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ref-progress-content::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 侧栏菜单样式 */
.ref-sidebar-menu {
    padding: 8px 0;
}

.ref-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: #333;
}

.ref-sidebar-item:hover {
    background-color: #f0f0f0;
}

.ref-sidebar-item.active {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .reference-modal-content {
        width: 95%;
    }

    .reference-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .reference-toolbar-left,
    .reference-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .reference-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .reference-table th,
    .reference-table td {
        padding: 8px 12px;
        font-size: 12px;
    }

    .ref-authors,
    .ref-title,
    .ref-journal {
        max-width: 150px;
    }

    .reference-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .reference-modal {
        background-color: rgba(0, 0, 0, 0.8);
    }

    .reference-modal-content {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

    .reference-modal-header,
    .reference-toolbar,
    .reference-modal-footer {
        background-color: #2d2d2d;
        border-color: #3d3d3d;
    }

    .reference-modal-header h2 {
        color: #e0e0e0;
    }

    .reference-stats {
        background-color: #252525;
        border-color: #3d3d3d;
        color: #aaa;
    }

    .reference-stats strong {
        color: #e0e0e0;
    }

    .reference-table {
        background-color: #1e1e1e;
    }

    .reference-table th {
        background-color: #2d2d2d;
        color: #e0e0e0;
        border-color: #3d3d3d;
    }

    .reference-table td {
        border-color: #2d2d2d;
    }

    .reference-table tbody tr:hover {
        background-color: #252525;
    }

    .ref-btn {
        background-color: #2d2d2d;
        border-color: #3d3d3d;
        color: #e0e0e0;
    }

    .ref-btn:hover {
        background-color: #3d3d3d;
    }

    #ref-search-input,
    #ref-filter-select,
    .ref-form-row input,
    .ref-form-row select {
        background-color: #2d2d2d;
        border-color: #3d3d3d;
        color: #e0e0e0;
    }

    .ref-tag {
        background-color: #1a3a52;
        color: #64b5f6;
    }
}

/* ============================================
   提取方式选择模态框
   ============================================ */

.extraction-method-options {
    display: grid;
    gap: 16px;
}

.extraction-method-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.extraction-method-item:hover {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.method-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.extraction-method-item:hover .method-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.method-info {
    flex: 1;
}

.method-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.method-info p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.method-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.method-info li {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

/* 特殊标记混合模式 */
.extraction-method-item[data-method="hybrid"] {
    border-color: #10b981;
    position: relative;
}

.extraction-method-item[data-method="hybrid"]::before {
    content: '推荐';
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.extraction-method-item[data-method="hybrid"]:hover {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.extraction-method-item[data-method="hybrid"] .method-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

