/* ========================================
   官方文档管理 - 样式
   ======================================== */

/* 文档页面主容器 */
.documents-main {
    padding: 20px;
    height: calc(100vh - 120px);
    overflow: hidden;
}

.documents-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: 100%;
}

/* 面板通用样式 - 灰色半透明 */
.folders-panel,
.files-panel {
    background: rgba(45, 55, 72, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    color: white;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* 文件夹列表 */
.folders-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.folder-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}

.folder-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.6);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.folder-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
    color: white;
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.folder-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    gap: 12px;
}

.folder-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.folder-item:hover .folder-actions {
    opacity: 1;
}

.folder-item.active .folder-actions {
    opacity: 1;
}

.folder-action-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.folder-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.folder-item.active .folder-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 文件列表 */
.files-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.file-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.file-icon {
    font-size: 32px;
    flex-shrink: 0;
}

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

.file-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #e5e7eb;
    flex: 1;
}

.file-desc-toggle {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.file-desc-toggle:hover {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
    transform: scale(1.1);
}

.file-description {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    line-height: 1.5;
    border-left: 3px solid rgba(102, 126, 234, 0.5);
}

.file-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    gap: 12px;
}

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

.file-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    font-weight: 500;
}

.file-action-btn.download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.file-action-btn.download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.file-action-btn.edit {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.file-action-btn.edit:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.6);
}

.file-action-btn.delete {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.file-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

/* 空状态 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

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

.empty-text {
    font-size: 16px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7);
}

.empty-hint {
    font-size: 14px;
    opacity: 0.5;
}

/* 按钮样式 */
.btn-secondary {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.5);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

/* 滚动条样式 */
.folders-list::-webkit-scrollbar,
.files-list::-webkit-scrollbar {
    width: 6px;
}

.folders-list::-webkit-scrollbar-track,
.files-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.folders-list::-webkit-scrollbar-thumb,
.files-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.folders-list::-webkit-scrollbar-thumb:hover,
.files-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .documents-container {
        grid-template-columns: 1fr;
        grid-template-rows: 40% 1fr;
    }

    .panel-header h3 {
        font-size: 14px;
    }

    .folder-name,
    .file-name {
        font-size: 13px;
    }

    .file-meta,
    .folder-meta {
        font-size: 11px;
    }
}

/* 文件类型图标颜色 */
.file-icon.pdf { color: #ef4444; }
.file-icon.doc,
.file-icon.docx { color: #3b82f6; }
.file-icon.xls,
.file-icon.xlsx { color: #10b981; }
.file-icon.ppt,
.file-icon.pptx { color: #f59e0b; }
.file-icon.zip,
.file-icon.rar,
.file-icon.7z { color: #8b5cf6; }
.file-icon.txt,
.file-icon.md { color: #6b7280; }
.file-icon.png,
.file-icon.jpg,
.file-icon.jpeg,
.file-icon.gif { color: #ec4899; }

/* 模态框输入框焦点样式 */
#folder-name-input:focus,
#folder-desc-input:focus,
#edit-folder-name-input:focus,
#edit-folder-desc-input:focus,
#edit-file-name-input:focus,
#edit-file-desc-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* 模态框输入框占位符样式 */
#folder-name-input::placeholder,
#folder-desc-input::placeholder,
#edit-folder-name-input::placeholder,
#edit-folder-desc-input::placeholder,
#edit-file-name-input::placeholder,
#edit-file-desc-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
