/* 文档管理容器 - 主容器样式 */
#documents-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px); /* 占满视窗高度减去顶部导航 */
    overflow: hidden;
}

/* 文档管理 */
.docs-manager-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.docs-manager-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.docs-manager-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex: 1;
    text-align: center;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: white;
    color: var(--text-secondary);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.back-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: rgba(67, 97, 238, 0.3);
    transform: translateY(-1px);
}

.upload-doc-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.upload-doc-btn:hover {
    background-color: #3850d0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.docs-manager-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
}

#documents-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    position: relative;
    padding: 8px 0 20px 0; /* 增加顶部padding为hover效果留出空间 */
}

/* 移除滚动条样式 */
.docs-list::-webkit-scrollbar {
    display: none;
}

/* 加载动画 */
.docs-loading {
    position: absolute;
    top: 8px; /* 调整顶部位置，配合新的padding */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.docs-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(67, 97, 238, 0.2);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.docs-loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.doc-item {
    margin-bottom: 0;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); /* 稍微增强基础阴影 */
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    animation: fadeIn 0.4s ease-out;
    z-index: 1; /* 基础层级 */
}

.doc-item:nth-child(even) {
    animation-delay: 0.1s;
}

.doc-item:nth-child(3n) {
    animation-delay: 0.2s;
}

.doc-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(67, 97, 238, 0.4);
    z-index: 2;
}

.doc-item:hover .doc-name {
    color: var(--primary-color);
}

.doc-item:hover .doc-type-badge {
    transform: scale(1.05);
}

.doc-header {
    display: flex;
    align-items: flex-start;
    padding: 18px 18px 10px 18px;
    gap: 14px;
}

.doc-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.doc-icon i {
    font-size: 24px;
    transition: all 0.2s;
}

.doc-item:hover .doc-icon {
    transform: scale(1.08);
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.doc-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.doc-meta i {
    font-size: 14px;
}

.doc-type-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: all 0.2s;
}

.doc-preview {
    padding: 0 18px 14px 18px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    min-height: 60px;
    position: relative;
}

.doc-actions {
    display: flex;
    padding: 12px 14px;
    border-top: 1px solid #f3f4f6;
    background-color: #fafbfc;
    gap: 8px;
    margin-top: auto;
}

.doc-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 6px;
    font-weight: 500;
    background-color: white;
    color: var(--text-secondary);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}

.doc-action-btn.view-btn {
    color: var(--primary-color);
    border-color: rgba(67, 97, 238, 0.3);
    background-color: rgba(67, 97, 238, 0.03);
}

.doc-action-btn.edit-btn {
    color: #0ea5e9;
    border-color: rgba(14, 165, 233, 0.3);
    background-color: rgba(14, 165, 233, 0.03);
}

.doc-action-btn.delete-btn {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.03);
}

.doc-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.doc-action-btn.view-btn:hover {
    background-color: rgba(67, 97, 238, 0.1);
    border-color: rgba(67, 97, 238, 0.5);
    color: var(--primary-color);
}

.doc-action-btn.edit-btn:hover {
    background-color: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.5);
    color: #0ea5e9;
}

.doc-action-btn.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

/* 文档详情页面样式优化 */
.doc-content-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.doc-content-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.edit-doc-btn, .delete-doc-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: white;
    color: var(--text-secondary);
    border: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-doc-btn {
    color: var(--primary-color);
    border-color: rgba(67, 97, 238, 0.3);
    background-color: rgba(67, 97, 238, 0.03);
}

.delete-doc-btn {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.03);
}

.edit-doc-btn:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-color: rgba(67, 97, 238, 0.5);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.delete-doc-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.doc-content-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.document-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    line-height: 1.6;
}

.document-metadata {
    width: 280px;
    padding: 24px;
    border-left: 1px solid var(--border-color);
    background-color: #f9fafb;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.doc-meta-item {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.doc-meta-item i {
    color: var(--primary-color);
    margin-top: 2px;
}

.image-preview {
    margin-bottom: 24px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.file-action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.doc-text-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
}

/* 添加文档页面样式 */
.add-document-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.add-document-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.add-document-header h2 {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    text-align: center;
}

.method-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.method-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: white;
    color: var(--text-secondary);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.method-tab:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: rgba(67, 97, 238, 0.3);
}

.method-tab.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: white;
    color: var(--text-secondary);
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.preview-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: rgba(67, 97, 238, 0.3);
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 