* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

.form-control {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.25);
    }

.form-select {
    background-color: var(--card-bg);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-primary:hover {
        background-color: var(--secondary-color);
        border-color: var(--secondary-color);
    }

/* 验证码样式 */
.captcha-img {
    width: 120px;
    height: 40px;
    cursor: pointer;
    border-radius: var(--bs-border-radius);
    object-fit: cover;
}

/* 主框架样式 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    transition: width var(--transition-speed) ease-in-out;
    overflow: visible !important;
    z-index: 100;
}

    .sidebar.collapsed {
        width: var(--sidebar-width-collapsed);
    }

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    overflow: hidden;
}

    .sidebar-logo img {
        width: 36px;
        margin-right: 10px;
        flex-shrink: 0;
    }

.sidebar-logo-text {
    font-size: 1.2rem;
    font-weight: bold;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition-speed) ease-in-out;
}

.sidebar.collapsed .sidebar-logo-text {
    opacity: 0;
}

.sidebar-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    transition: opacity var(--transition-speed) ease-in-out;
}

.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-speed);
    overflow: hidden;
    white-space: nowrap;
}

    .sidebar-link:hover,
    .sidebar-link.active {
        background-color: rgba(22, 93, 255, 0.1);
        color: var(--primary-color);
    }

.sidebar-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-text {
    opacity: 1;
    transition: opacity var(--transition-speed) ease-in-out;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-text {
    opacity: 0;
}

/* 多级菜单样式 */
.sidebar-item.has-children > .sidebar-link {
    position: relative;
}

.sidebar-arrow {
    position: absolute;
    right: 1rem;
    font-size: 0.8rem;
    transition: transform var(--transition-speed);
}

.sidebar-item.open > .sidebar-link > .sidebar-arrow {
    transform: rotate(90deg);
}

.sidebar-submenu {
    list-style: none;
    padding-left: 1.5rem;
    display: none;
}

    .sidebar-submenu.show {
        display: block;
        animation: fadeIn 0.3s ease-in-out;
    }

    /* 二级菜单图标 */
    .sidebar-submenu .sidebar-icon.bi-circle {
        font-size: 0.5rem;
    }

    /* 三级菜单图标 */
    .sidebar-submenu .sidebar-submenu .sidebar-icon.bi-dot {
        font-size: 1rem;
    }

/* 折叠状态下的子菜单样式 */
.sidebar.collapsed .sidebar-item {
    position: relative;
}

.sidebar.collapsed .sidebar-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    z-index: 100;
    display: none;
}

.sidebar.collapsed .sidebar-item:hover > .sidebar-submenu {
    display: block;
}

.sidebar.collapsed .sidebar-submenu .sidebar-item:hover > .sidebar-submenu {
    left: 100%;
    top: 0;
    display: block;
}

.sidebar.collapsed .sidebar-submenu .sidebar-link {
    padding: 0.5rem 1rem;
}

.sidebar.collapsed .sidebar-submenu .sidebar-text {
    opacity: 1;
    display: inline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease-in-out;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-width-collapsed);
}

/* 顶部导航栏 */
.top-nav {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.nav-left {
    display: flex;
    align-items: center;
}

.mobile-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-right: 1rem;
    display: none;
    cursor: pointer;
}

/* 当前页面标题样式 */
.current-page-title {
    font-size: 1.1rem;
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-switch {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
}

.language-select {
    background-color: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Tab页样式 */
.tab-container {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
}

.tab-item {
    position: relative;
}

.tab-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-speed);
    white-space: nowrap;
}

    .tab-link.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

.tab-close {
    margin-left: 0.5rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0.7;
    transition: all var(--transition-speed);
}

    .tab-close:hover {
        background-color: rgba(0, 0, 0, 0.1);
        opacity: 1;
    }

.tab-content {
    padding: 1.5rem;
    min-height: calc(100vh - 170px);
}

/* 仪表盘样式 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.trend-up {
    color: #00B42A;
}

.trend-down {
    color: #F53F3F;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-title {
    font-weight: 600;
}

/* 列表页样式 */
.filter-panel {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
}

.filter-title {
    font-weight: 600;
}

.filter-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.table-responsive {
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

    .table th,
    .table td {
        vertical-align: middle;
        border-bottom: 1px solid var(--border-color);
    }

    .table th {
        background-color: rgba(0, 0, 0, 0.02);
        font-weight: 600;
    }

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 详情页样式 */
.detail-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.detail-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 0;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* 右键菜单样式 */
.context-menu {
    position: absolute;
    width: 150px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

    .context-menu.show {
        display: block;
    }

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

    .context-menu-item:hover {
        background-color: rgba(22, 93, 255, 0.1);
        color: var(--primary-color);
    }

/* 工具类 */
.page {
    display: none;
}

    .page.active {
        display: block;
    }

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.mb-6 {
    margin-bottom: 1.5rem !important;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1050;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .nav-right {
        display: none !important;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }
}

/* 标签美化样式 */
.badge {
    padding: 0.5em 0.75em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 12px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .badge.badge-sm {
        font-size: 0.65em;
        padding: 0.3em 0.6em;
    }

    .badge.badge-lg {
        font-size: 0.85em;
        padding: 0.6em 0.9em;
    }

    .badge.bg-success {
        background-color: #00B42A !important;
        color: white;
    }

    .badge.bg-secondary {
        background-color: #F53F3F !important;
        color: white;
    }

    .badge.bg-warning {
        background-color: #FF7D00 !important;
        color: white;
    }

    .badge.bg-info {
        background-color: #2080F0 !important;
        color: white;
    }

    .badge.bg-primary {
        background-color: var(--primary-color) !important;
        color: white;
    }

    .badge.bg-dark {
        background-color: #1D1E20 !important;
        color: white;
    }

    .badge.bg-light {
        background-color: #F5F7FA !important;
        color: #333;
    }

.badge-outline {
    background-color: transparent;
    border: 1px solid currentColor;
}

    .badge-outline.badge-success {
        color: #00B42A;
    }

    .badge-outline.badge-secondary {
        color: #F53F3F;
    }

    .badge-outline.badge-warning {
        color: #FF7D00;
    }

    .badge-outline.badge-info {
        color: #2080F0;
    }

    .badge-outline.badge-primary {
        color: var(--primary-color);
    }

    .badge-outline.badge-dark {
        color: #1D1E20;
    }

    .badge-outline.badge-light {
        color: #666666;
        border-color: #E5E6EB;
    }

/* 不同形状的标签 */
.badge-rounded {
    border-radius: 20px;
}

.badge-square {
    border-radius: 4px;
}

.badge-pill {
    border-radius: 50rem;
    padding-right: 0.8em;
    padding-left: 0.8em;
}

/* 带图标的标签 */
.badge-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* 软色标签 (soft badges) */
.badge-soft-success {
    background-color: rgba(0, 180, 42, 0.1);
    color: #00B42A;
}

.badge-soft-secondary {
    background-color: rgba(245, 63, 63, 0.1);
    color: #F53F3F;
}

.badge-soft-warning {
    background-color: rgba(255, 125, 0, 0.1);
    color: #FF7D00;
}

.badge-soft-info {
    background-color: rgba(32, 128, 240, 0.1);
    color: #2080F0;
}

.badge-soft-primary {
    background-color: rgba(22, 93, 255, 0.1);
    color: var(--primary-color);
}

.badge-soft-dark {
    background-color: rgba(29, 30, 32, 0.1);
    color: #1D1E20;
}

.badge-soft-light {
    background-color: rgba(245, 247, 250, 0.8);
    color: #666666;
}

/* 加载动画样式 */
.loading-wait {
    z-index: 10001;
    position: absolute;
}

.loading-mask {
    z-index: 10000;
    position: absolute;
    background-color: silver;
    filter: alpha(opacity=30);
    -moz-opacity: 0.3;
    opacity: 0.3;
}

.loading-img {
    width: 65px;
    height: 65px;
    /* 适配不同尺寸 */
    &[src$="loading-full.gif"] {
        width: 100px;
        height: 100px;
    }
}

/* tom select 下拉全选按钮样式 */
/* 下拉框顶部按钮组样式 */
.ts-actionsbox {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* 防止搜索框被遮挡 */
.ts-dropdown .ts-search {
    margin-top: 0.25rem !important;
}

/* jstree 自定义样式调整 */
#jstree-container {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.jstree-default > .jstree-striped {
    background: none !important;
}

.jstree-default .jstree-hovered {
    background-color: var(--light-bg2) !important;
}

.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered {
    background: var(--light-bg2) !important;
}