/* 基础布局 */
html {
    overflow-y: auto;
    scrollbar-gutter: stable;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 56px; /* 为固定导航栏留出空间 */
    overflow-x: hidden; /* 防止水平滚动 */
    width: 100%;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    background-color: rgba(31, 41, 51, 0.94) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    height: 56px;
}

.navbar.scrolled {
    background-color: rgba(31, 41, 51, 0.98) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.navbar-brand {
    color: #3498db !important;
    font-weight: bold;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.2s;
    padding: 0.5rem 1rem !important;
    height: 56px;
    display: flex;
    align-items: center;
}

/* 导航图标和文本间距 */
.navbar .nav-link i {
    margin-right: 6px;
    font-size: 16px;
}

.navbar .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
}

.navbar .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.18);
}

/* 导航栏下拉菜单样式 */
.navbar .dropdown-menu {
    margin-top: 0;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
    position: absolute;
    right: 0;
    left: auto;
    min-width: 200px;
    border-radius: 4px;
    padding: 0.5rem 0;
    background: white;
    z-index: 1031;
}

.navbar .nav-item.dropdown {
    position: relative;
}

.navbar .dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
}

.navbar .dropdown-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    transition: all 0.2s ease;
}

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

.navbar .dropdown-item i {
    margin-right: 6px;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.navbar .dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid #eee;
}

/* 确保下拉菜单在最上层 */
.dropdown-menu.show {
    z-index: 1050 !important;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 主要内容区域 */
main {
    flex: 1;
    background-color: #dee2e6;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* 页脚样式 */
.footer {
    background-color: white;
    padding: 0.375rem 0;
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
    flex-shrink: 0;
}

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

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* 消息提示样式 */
#messageContainer {
    position: fixed;
    top: 300px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.message-toast {
    margin-bottom: 10px;
    min-width: 250px;
    padding: 15px;
    border-radius: 4px;
    color: white;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: auto;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.message-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 消息类型样式 */
.message-toast.success { background-color: rgba(40, 167, 69, 0.9); }
.message-toast.error { background-color: rgba(220, 53, 69, 0.9); }
.message-toast.info { background-color: rgba(23, 162, 184, 0.9); }
.message-toast.warning { background-color: rgba(255, 193, 7, 0.9); }

/* 加载遮罩样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 左侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100vh;
    background-color: #000;
    z-index: 1030;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-logo img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px;
    margin-bottom: 15px;
    object-fit: cover;
}

.sidebar-title {
    color: white;
    font-size: 14px;
    text-align: center;
    padding: 0 10px;
    margin-bottom: 0;
}

.sidebar-nav {
    padding: 0 15px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 15px;
}

.sidebar-nav-item i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar-nav-item.active {
    background-color: #3498db;
    color: white;
    box-shadow: 0 4px 12px rgba(52,152,219,0.3);
}

/* 带侧边栏的布局样式 */
.with-sidebar .navbar {
    left: 200px !important;
    z-index: 1020 !important;
}

.with-sidebar .main-content {
    margin-left: 200px;
    flex: 1;
    min-height: auto;
    background-color: #dee2e6;
}

.with-sidebar main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.with-sidebar .footer {
    margin-left: 200px;
}

.with-sidebar .navbar .container {
    max-width: calc(100% - 2rem);
    padding: 0 1rem;
}

/* 导航文本样式 */
.navbar .nav-text {
    font-size: 14px;
}

/* 页面标题样式 */
.page-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.page-title i {
    margin-right: 6px;
    color: #3498db;
}

/* 统一全局导航栏容器宽度 - 确保与各插件内容区域宽度一致 */
@media (min-width: 1200px) and (max-width: 1399px) {
    .navbar .container,
    .navbar .container-fluid {
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (min-width: 1400px) {
    .navbar .container,
    .navbar .container-fluid {
        max-width: 1320px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* 统一顶部全局导航栏的位置 */
.navbar > .container,
.navbar > .container-fluid {
    position: relative !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* 固定右侧导航按钮位置 */
body .navbar .navbar-nav:not(.me-auto) {
    position: absolute !important;
    right: 15px !important;
    display: flex !important;
    align-items: center !important;
    z-index: 1031 !important; /* 确保显示在最上层 */
}

/* 确保登录/刷新按钮位置固定 */
body .navbar .nav-item .nav-link {
    padding: 0 10px !important;
    height: 56px !important;
    display: flex !important;
    align-items: center !important;
}

/* 确保全局导航栏按钮位置不受插件CSS影响 */
html body .navbar .navbar-nav:not(.me-auto) .nav-item,
html body .navbar .navbar-nav:not(.me-auto) .nav-link,
html body .navbar .navbar-nav:not(.me-auto) {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

/* 统一顶部导航栏布局，确保按钮位置一致 */
.navbar-light .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem !important;
}

/* 防止弹窗打开时页面左右移动 */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important; /* 防止 Bootstrap 添加 padding 导致移动 */
    margin-right: 0 !important; /* 防止 margin 导致移动 */
} 