/* 管理后台样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    padding-top: 56px; /* 为固定导航栏留出空间 */
}

/* 分隔线样式 */
.divider-text {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: #dee2e6;
}

.divider-text::before {
    left: 0;
}

.divider-text::after {
    right: 0;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 20px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar-sticky {
    position: sticky;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-link:hover {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.sidebar .nav-link.active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 3px solid #0d6efd;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
}

/* 主内容区样式 */
main {
    padding-top: 1rem;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* 统计卡片 */
.stat-card {
    border-left: 4px solid;
}

.stat-card.primary {
    border-left-color: #0d6efd;
}

.stat-card.success {
    border-left-color: #198754;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.danger {
    border-left-color: #dc3545;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

/* 表格样式 */
.table {
    background-color: #fff;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: #6c757d;
}

/* 按钮样式 */
.btn-group-xs > .btn, .btn-xs {
    padding: .25rem .5rem;
    font-size: .875rem;
    line-height: 1.5;
    border-radius: .2rem;
}

/* 搜索框样式 */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* 分页样式 */
.pagination {
    margin-bottom: 0;
}

/* 模态框样式 */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* 代码编辑器样式 */
.code-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 1rem;
    min-height: 300px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        padding: 0;
    }
    
    main {
        margin-top: 0;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* 加载动画 */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Toast样式 */
.toast {
    min-width: 300px;
}

/* 状态标签 */
.badge-status {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-status.online {
    background-color: #198754;
    color: white;
}

.badge-status.offline {
    background-color: #6c757d;
    color: white;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* 多选下拉组件样式 */
.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-input {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.multi-select-input:hover {
    border-color: #86b7fe;
}

.multi-select-input:focus-within {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.multi-select-input .selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-right: 0.5rem;
}

.multi-select-input .search-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    padding: 0;
    min-width: 100px;
    font-size: 1rem;
}

.multi-select-input .dropdown-arrow {
    position: absolute;
    right: 0.75rem;
    color: #6c757d;
    transition: transform 0.2s;
}

.multi-select-input .dropdown-arrow.open {
    transform: rotate(180deg);
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #0d6efd;
    color: white;
    border-radius: 0.25rem;
}

.selected-tag i {
    margin-left: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.selected-tag i:hover {
    opacity: 0.8;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
}

.multi-select-dropdown .options-list {
    padding: 0.25rem 0;
}

.multi-select-dropdown .dropdown-item {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.multi-select-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.multi-select-dropdown .dropdown-item.selected {
    background-color: #e7f1ff;
}

.multi-select-dropdown .dropdown-item .form-check-input {
    margin-top: 0.25rem;
    cursor: pointer;
}

.multi-select-dropdown .dropdown-item .item-label {
    flex: 1;
    margin-left: 0.5rem;
}

.multi-select-dropdown .dropdown-item .item-desc {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.multi-select-dropdown .loading-indicator,
.multi-select-dropdown .no-results {
    padding: 1rem;
    color: #6c757d;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .multi-select-input .search-input {
        min-width: 50px;
    }
    
    .multi-select-dropdown {
        max-height: 200px;
    }
}