 /* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f7fa;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    text-align: center;
    color: #409eff;
}

.loading-spinner i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.loading-spinner div {
    font-size: 16px;
    font-weight: 500;
}

/* 全局加载状态 */
body.loading {
    cursor: wait;
}

body.loading * {
    pointer-events: none;
}

/* 主布局 */
.layout-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: #2c3e50;
    color: #ecf0f1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-header i {
    margin-right: 8px;
    color: #3498db;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav .nav-item {
    display: block;
    padding: 15px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-item:hover {
    background: #34495e;
    color: #ecf0f1;
    border-left-color: #3498db;
}

.sidebar-nav .nav-item.active {
    background: #34495e;
    color: #3498db;
    border-left-color: #3498db;
}

.sidebar-nav .nav-item i {
    margin-right: 12px;
    width: 16px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部工具栏 */
.main-header {
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    padding: 8px;
    margin-right: 16px;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f0f0f0;
    color: #333;
}

#page-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.header-right {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    transition: all 0.3s ease;
}

.status-dot.online {
    background: #67c23a;
    box-shadow: 0 0 8px rgba(103, 194, 58, 0.5);
}

.status-dot.offline {
    background: #f56c6c;
    box-shadow: 0 0 8px rgba(245, 108, 108, 0.5);
}

.status-dot.connecting {
    background: #e6a23c;
    box-shadow: 0 0 8px rgba(230, 162, 60, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f7fa;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #ebeef5;
    background: #fafafa;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    background: #fafafa;
    border-top: 1px solid #ebeef5;
    text-align: right;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    background: none;
    outline: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #66b1ff;
    border-color: #66b1ff;
}

.btn-success {
    background: #67c23a;
    border-color: #67c23a;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #85ce61;
    border-color: #85ce61;
}

.btn-warning {
    background: #e6a23c;
    border-color: #e6a23c;
    color: #fff;
}

.btn-warning:hover:not(:disabled) {
    background: #ebb563;
    border-color: #ebb563;
}

.btn-danger {
    background: #f56c6c;
    border-color: #f56c6c;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #f78989;
    border-color: #f78989;
}

.btn-secondary {
    background: #909399;
    border-color: #909399;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #a6a9ad;
    border-color: #a6a9ad;
}

.btn-outline {
    background: transparent;
    color: #409eff;
    border-color: #409eff;
}

.btn-outline:hover:not(:disabled) {
    background: #409eff;
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.form-control:disabled {
    background: #f5f7fa;
    color: #c0c4cc;
}

.form-control.error {
    border-color: #f56c6c;
}

.form-text {
    font-size: 12px;
    color: #909399;
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: #f56c6c;
    margin-top: 4px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

.table th {
    background: #fafafa;
    font-weight: 600;
    color: #2c3e50;
}

.table tbody tr:hover {
    background: #f5f7fa;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.pagination .page-item {
    margin: 0 2px;
}

.pagination .page-link {
    display: block;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    color: #606266;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: #f5f7fa;
    border-color: #c0c4cc;
}

.pagination .page-item.active .page-link {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #c0c4cc;
    cursor: not-allowed;
}

/* 消息提示样式 */
#message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.message {
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: translateX(0);
}

.message.hide {
    opacity: 0;
    transform: translateX(100%);
}

.message-content {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid #409eff;
}

.message-success .message-content {
    border-left-color: #67c23a;
}

.message-warning .message-content {
    border-left-color: #e6a23c;
}

.message-error .message-content {
    border-left-color: #f56c6c;
}

.message-icon {
    margin-right: 8px;
    font-size: 16px;
}

.message-success .message-icon {
    color: #67c23a;
}

.message-warning .message-icon {
    color: #e6a23c;
}

.message-error .message-icon {
    color: #f56c6c;
}

.message-info .message-icon {
    color: #409eff;
}

.message-text {
    flex: 1;
    color: #2c3e50;
}

.message-close {
    background: none;
    border: none;
    color: #c0c4cc;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    font-size: 14px;
}

.message-close:hover {
    color: #909399;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-overlay.hide {
    opacity: 0;
}

.modal-dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-dialog {
    transform: scale(1);
}

.modal-header {
    padding: 20px 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #c0c4cc;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: #909399;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 0 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100%;
    }
    
    .content-area {
        padding: 12px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    #message-container {
        left: 12px;
        right: 12px;
        max-width: none;
    }
    
    .modal-dialog {
        width: 95%;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.flex-1 { flex: 1; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }

.text-primary { color: #409eff; }
.text-success { color: #67c23a; }
.text-warning { color: #e6a23c; }
.text-danger { color: #f56c6c; }
.text-muted { color: #909399; }