/* 企业级管理系统样式 */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f7fa;
}

/* 页面容器 */
.page-container {
    min-height: calc(100vh - 60px);
    padding: 20px;
}

/* 页面头部 */
.page-header {
    background: white;
    padding: 20px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #1890ff;
}

.page-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
}

/* 工具栏 */
.toolbar {
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar .btn-group {
    display: flex;
    gap: 8px;
}

/* 搜索框 */
.search-box {
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box .search-input {
    flex: 1;
    max-width: 400px;
}

/* 数据表格容器 */
.datagrid-container {
    background: white;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* 表格样式 */
table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th {
    background-color: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #666;
}

table.data-table td {
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 16px;
}

table.data-table tr:hover {
    background-color: #f5f5f5;
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 16px 24px;
    background: white;
    border-top: 1px solid #f0f0f0;
}

/* 弹出对话框 */
.dialog {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dialog .dialog-header {
    background: #1890ff;
    color: white;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
}

.dialog .dialog-body {
    padding: 24px;
}

.dialog .dialog-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 表单样式 */
.form-table {
    width: 100%;
    border-collapse: collapse;
}

.form-table td {
    padding: 12px 8px;
    vertical-align: top;
}

.form-table .label {
    width: 120px;
    text-align: right;
    font-weight: 600;
    color: #666;
    padding-right: 16px;
}

.form-table .input-cell {
    flex: 1;
}

.form-table .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.form-table .form-control:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #d9d9d9;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-container {
        padding: 10px;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .search-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .search-box .search-input {
        width: 100%;
        max-width: none;
    }
    
    .form-table {
        display: block;
    }
    
    .form-table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 12px;
    }
    
    .form-table .label {
        width: 100%;
        text-align: left;
        padding-right: 0;
        margin-bottom: 4px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.message-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.message-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.message-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}