/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 登录表单样式 */
.login-form {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 100px auto;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #45a049;
}

.error-message {
    background-color: #f44336;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* FTP管理器样式 */
.ftp-manager {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h2 {
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background-color: #f44336;
    text-decoration: none;
}

.logout-btn:hover {
    background-color: #d32f2f;
}

.main-content {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.file-browser {
    flex: 1;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
}

.browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.browser-header h3 {
    color: #333;
    margin: 0;
}

.browser-actions {
    display: flex;
    gap: 10px;
}

#file-list {
    margin-top: 10px;
}

.advanced-actions {
    margin-top: 20px;
}

.action-group {
    margin-bottom: 15px;
}

.action-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.action-group input {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 上传进度条样式 */
#upload-progress {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.progress-container {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

#progress-percentage {
    font-weight: bold;
    color: #333;
}

.batch-operations {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 5px;
}

.batch-buttons {
    display: flex;
    gap: 10px;
}

.batch-btn {
    font-size: 14px;
    padding: 8px 12px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.file-item:hover {
    background-color: #f0f0f0;
}

.file-checkbox {
    margin-right: 15px;
}

.file-info-container {
    flex: 1;
}

.file-name {
    font-weight: bold;
}

.file-info {
    font-size: 12px;
    color: #666;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.download-btn {
    background-color: #2196F3;
    color: white;
}

.preview-btn {
    background-color: #ff9800;
    color: white;
}

.unzip-btn {
    background-color: #9c27b0;
    color: white;
}

.edit-btn {
    background-color: #2196F3;
    color: white;
}

.delete-btn {
    background-color: #f44336;
    color: white;
}

/* 编辑模态框样式 */
.edit-modal-content {
    width: 80%;
    max-width: 800px;
}

.edit-body {
    margin-top: 20px;
}

#file-content {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
}

.edit-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cancel-btn {
    background-color: #9e9e9e;
}

.cancel-btn:hover {
    background-color: #757575;
}

/* 预览模态框样式 */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.preview-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    overflow: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

.preview-body {
    margin-top: 20px;
}

.preview-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.preview-body video {
    max-width: 100%;
    max-height: 70vh;
}

.upload-section {
    width: 300px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
}

.upload-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#file-upload {
    margin-bottom: 15px;
    width: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .upload-section {
        width: 100%;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .user-info {
        flex-wrap: wrap;
    }
}