/* 主样式文件 */

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 卡片样式 */
.card {
    border-radius: 0.75rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    border-bottom: none;
}

/* 按钮样式 */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* 表单样式 */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* 特性图标样式 */
.feature-icon {
    transition: transform 0.2s ease-in-out;
}

.feature-icon:hover {
    transform: scale(1.1);
}

/* 英雄区域样式 */
.hero-section {
    padding: 3rem 0;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 页脚样式 */
footer {
    margin-top: auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

/* 警告框样式 */
.alert {
    border-radius: 0.5rem;
    border: none;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* 下拉菜单样式 */
.dropdown-menu {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.15s ease-in-out;
}

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

/* 分页样式 */
.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    border: 1px solid #dee2e6;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 统一的标题样式 */
.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 1rem;
}

.subsection-title {
    font-size: 1rem;
    font-weight: 500;
    color: #7f8c8d;
    margin-bottom: 0.75rem;
}

/* 统一的按钮样式 */
.btn-action {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-action-sm {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.btn-action-lg {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

/* 表格样式 */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    border-top: none;
    background-color: #f8f9fa;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.table thead th.sortable:hover {
    background-color: #e9ecef;
}

.table thead th.sortable::after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.5;
    font-size: 0.8em;
}

.table thead th.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: #0d6efd;
}

.table thead th.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: #0d6efd;
}

/* Grafana风格的列筛选 */
.table thead th.filterable {
    position: relative;
}

.table thead th.filterable::before {
    content: '🔽';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    opacity: 0.6;
    cursor: pointer;
    z-index: 10;
}

.table thead th.filterable:hover::before {
    opacity: 1;
}

.table thead th.filterable.filter-active::before {
    content: '🔽';
    opacity: 1;
    color: #0d6efd;
}

/* 筛选下拉菜单 */
.column-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.column-filter-dropdown.show {
    display: block;
}

.column-filter-header {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.column-filter-search {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.column-filter-options {
    max-height: 200px;
    overflow-y: auto;
}

.column-filter-option {
    padding: 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-filter-option:hover {
    background-color: #f8f9fa;
}

.column-filter-option input[type="checkbox"] {
    margin: 0;
}

.column-filter-option.selected {
    background-color: #e3f2fd;
}

.column-filter-footer {
    padding: 0.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.column-filter-footer .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* 表格筛选器样式 */
.table-filters {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 500;
    color: #495057;
    min-width: 80px;
    font-size: 0.875rem;
}

.filter-input {
    flex: 1;
    max-width: 200px;
}

.filter-select {
    min-width: 120px;
}

/* 搜索和清除按钮组合样式 */
.search-clear-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-clear-group .filter-input {
    flex: 1;
    max-width: 150px;
}

/* 侧边栏布局样式 */
.sidebar-layout {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-brand:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.sidebar-nav .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    border-right: 3px solid white;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.user-actions {
    display: flex;
    gap: 0.25rem;
}

.user-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* 主内容区域 */
.main-content {
    margin-left: 180px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* 移动端侧边栏切换按钮 */
.sidebar-toggle-mobile {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #667eea;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.sidebar-toggle-mobile:hover {
    background: #5a6fd8;
    color: white;
}



.content-area {
    flex: 1;
    padding: 1.5rem;
    background-color: #f8f9fa;
}

.main-footer {
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 1rem 0;
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-area {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    .top-toolbar {
        padding: 0.75rem 1rem;
    }
    
    .toolbar-title {
        font-size: 1.25rem;
    }
    
    .content-area {
        padding: 0.75rem;
    }
}

/* 专业级分页样式 */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.pagination-info-left {
    color: #6c757d;
    font-weight: 500;
}

.pagination-controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-size-select {
    width: auto;
    min-width: 60px;
    font-size: 0.875rem;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #495057;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

/* 导航按钮（首页、上一页、下一页、末页）统一宽度 */
.pagination-btn.first,
.pagination-btn.prev,
.pagination-btn.next,
.pagination-btn.last {
    min-width: 32px;
    width: 32px;
    padding: 0.25rem 0.25rem;
    text-align: center;
}

.pagination-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.pagination-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.pagination-btn.ellipsis {
    cursor: default;
    background-color: transparent;
    border: none;
    color: #6c757d;
}

.pagination-btn.ellipsis:hover {
    background-color: transparent;
    border: none;
    color: #6c757d;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background-color: #fff;
    border-color: #dee2e6;
    color: #495057;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .table-pagination {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .pagination-info-left {
        text-align: center;
        order: 2;
    }
    
    .pagination-controls-right {
        justify-content: center;
        order: 1;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-label {
        min-width: auto;
        margin-bottom: 0.25rem;
    }
    
    .filter-input,
    .filter-select {
        max-width: none;
        min-width: auto;
    }
}

/* 模态框样式 */
.modal-content {
    border-radius: 0.75rem;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.75rem 0.75rem;
}
