/* 模态框样式 */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* 针对不同内容的modal-content样式 */
.modal-content[style*="max-width: 800px"] {
    max-width: 800px;
    max-height: 85vh;
}

.modal-content[style*="max-width: 500px"] {
    max-width: 500px;
    max-height: 80vh;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 70vh;
        padding: 15px;
    }
    
    .modal-content[style*="max-width: 800px"] {
        max-width: 95%;
        max-height: 75vh;
    }
    
    .modal-content[style*="max-width: 500px"] {
        max-width: 95%;
        max-height: 70vh;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 图片模态框样式 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 80vh; /* 限制最大高度为视口高度的80% */
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain; /* 保持图片比例 */
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

/* 图片模态框响应式设计 */
@media (max-width: 768px) {
    .image-modal-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .image-modal img {
        max-height: 70vh; /* 在移动设备上进一步限制高度 */
    }
    
    .image-modal-close {
        top: 15px;
        right: 20px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .image-modal img {
        max-height: 60vh; /* 在小屏幕上进一步限制高度 */
    }
    
    .image-modal-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
}

/* 文件信息模态框样式 */
.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 针对markdown内容的特殊样式 */
#markdown-content {
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    line-height: 1.5;
}

/* 文件信息显示样式 */
.file-info-display {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    word-break: break-word;
}

.file-icon-large {
    font-size: 48px;
    color: #666;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0; /* 防止flex项目溢出 */
}

.file-details h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    word-break: break-word;
}

.file-details p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.file-actions-modal {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
} 