* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* 容器布局 */
.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e4e7ed;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.admin-btn {
    padding: 6px 12px;
    background: #409eff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.admin-btn:hover {
    background: #66b1ff;
}

/* 文件列表 */
.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.file-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f9fafc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-item:hover {
    background: #ecf5ff;
}

.file-item.active {
    background: #409eff;
    color: white;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-time {
    font-size: 12px;
    color: #909399;
}

.file-item.active .file-time {
    color: rgba(255, 255, 255, 0.8);
}

.loading, .no-files, .error {
    text-align: center;
    padding: 40px 20px;
    color: #909399;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.editor-header {
    padding: 20px;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.editor-actions button {
    padding: 8px 16px;
    background: #409eff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.editor-actions button:hover {
    background: #66b1ff;
}

.editor-actions button:disabled {
    background: #c0c4cc;
    cursor: not-allowed;
}

/* 编辑器区域 */
.editor-wrapper {
    flex: 1;
    position: relative;
}

.editor-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #909399;
    font-size: 16px;
}

/* 登录页面 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 360px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #606266;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #409eff;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #409eff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-primary:hover {
    background: #66b1ff;
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: #909399;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #a6a9ad;
}

/* 管理员界面 */
.admin-header {
    padding: 20px 30px;
    background: white;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-actions button {
    padding: 8px 16px;
    margin-left: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.header-actions button:first-child {
    background: #409eff;
    color: white;
}

.header-actions button:last-child {
    background: #f56c6c;
    color: white;
}

.admin-content {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

/* 上传区域 */
.upload-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.upload-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

.upload-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.upload-form input[type="file"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
}

.upload-form button {
    padding: 10px 20px;
}

/* 文件区域 */
.files-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.files-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

.admin-file-list {
    min-height: 100px;
}

.admin-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e4e7ed;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.admin-file-item:hover {
    background: #f9fafc;
}

.file-info {
    flex: 1;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: white;
}

.btn-danger {
    background: #f56c6c;
}

.btn-danger:hover {
    background: #f78989;
}

.btn-success {
    background: #67c23a;
}

.btn-success:hover {
    background: #85ce61;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    height: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #909399;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-btn:hover {
    color: #f56c6c;
}

.modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .admin-content {
        padding: 15px;
    }
    
    .upload-form {
        flex-direction: column;
    }
    
    .upload-form input[type="file"],
    .upload-form button {
        width: 100%;
    }
    
    .admin-file-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-actions {
        margin-top: 10px;
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        height: 95%;
    }
}
