/* 主题颜色变量 */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1976D2;
    --primary-light: #3b82f6;
    --text-on-primary: #fff;
    --sidebar-width: 280px;
    --sidebar-width-xl: 240px;
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;
    --scrollbar-width: 8px;
    --scrollbar-height: 8px;
    --scrollbar-track-dark: rgba(255,255,255,0.1);
    --scrollbar-thumb-dark: rgba(255,255,255,0.2);
    --scrollbar-thumb-hover-dark: rgba(255,255,255,0.3);
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    background: #f8f9fa;
}

/* 侧边栏样式 */
.sidebar {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    width: var(--sidebar-width);
}

.logo-container {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}

.logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

.project-title {
    margin: 0.5rem 0;
}

.project-name {
    color: var(--text-on-primary);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.project-desc {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.version {
    background: rgba(255,255,255,0.2) !important;
    font-weight: normal;
    margin-top: 0.5rem;
}

/* 搜索框样式 */
.input-group {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

.input-group-text {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
}

#searchInput {
    background: transparent;
    border: none;
    color: var(--text-on-primary);
    font-size: 0.9rem;
}

#searchInput::placeholder {
    color: rgba(255,255,255,0.5);
}

#searchInput:focus {
    box-shadow: none;
    background: rgba(255,255,255,0.05);
}

/* 导航菜单样式 */
.nav-menu {
    width: 100%;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--text-on-primary);
    background: rgba(255,255,255,0.1);
}

.nav-link.active {
    background: var(--text-on-primary);
    color: var(--primary-color);
    font-weight: 500;
}

.nav-link .icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.nav-link[aria-expanded="true"] .icon {
    transform: rotate(-180deg);
}

.submenu {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    margin: 0;
    padding: 0.5rem;
}

.submenu .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* 手风琴效果 */
.accordion-item {
    background: transparent;
    border: none;
}

.accordion-button {
    background: transparent;
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: none;
    position: relative;
    display: flex;
    align-items: center;
}

.accordion-button:not(.collapsed) {
    background: rgba(255,255,255,0.1);
    color: #fff;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-button::after {
    font-family: 'FontAwesome';
    content: '\f105' !important;
    background-image: none;
    width: auto;
    height: auto;
    color: rgba(255,255,255,0.7);
    transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(90deg);
    color: #fff;
}

.accordion-body {
    padding: 0.5rem;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

/* 方法标签样式 */
.nav-link .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-weight: normal;
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-link .badge.GET {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(30, 142, 62, 0.3);
}

.nav-link .badge.POST {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(26, 115, 232, 0.3);
}

.nav-link .badge.PUT {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(230, 119, 0, 0.3);
}

.nav-link .badge.DELETE {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(217, 48, 37, 0.3);
}

/* 激活状态下的徽章颜色 */
.nav-link.active .badge {
    opacity: 0.9;
    border: none;
}

.nav-link.active .badge.GET {
    background: #1e8e3e !important;
    color: #fff !important;
}

.nav-link.active .badge.POST {
    background: #1a73e8 !important;
    color: #fff !important;
}

.nav-link.active .badge.PUT {
    background: #e67700 !important;
    color: #fff !important;
}

.nav-link.active .badge.DELETE {
    background: #d93025 !important;
    color: #fff !important;
}

/* 菜单项内容样式 */
.nav-link span {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* 内容区域样式 */
.content-wrapper {
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease;
}

.content-header {
    background: var(--text-on-primary);
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
}

.breadcrumb {
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-item a,
.breadcrumb-item .home-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover,
.breadcrumb-item .home-link:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #6c757d;
}

.content-body {
    height: calc(100vh - 56px);
    overflow-y: hidden;
    padding: 1.5rem;
    position: relative;
}

.doc-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* 响应式整 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 2px 0 12px rgba(0,0,0,0.2);
    }
    
    /* 手机端菜单样式调整 */
    .logo-container {
        padding: 1rem;
    }
    
    .logo {
        width: 40px;
        height: 40px;
    }
    
    .project-title {
        margin: 0.25rem 0;
    }
    
    .search-container {
        padding: 0.75rem 1rem 0.5rem;
    }
    
    .menu-container {
        padding: 0.5rem 0.75rem 1rem;
    }
    
    .nav-link {
        padding: 0.625rem 0.875rem;
        font-size: 0.95rem;
    }
    
    .submenu .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.875rem;
    }
    
    /* 添加关闭按钮 */
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .close-sidebar {
        color: rgba(255,255,255,0.8);
        font-size: 1.25rem;
        padding: 0.25rem;
        cursor: pointer;
        transition: color 0.2s;
    }
    
    .close-sidebar:hover {
        color: #fff;
    }
}

/* Toast 提示框样式 */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.toast-icon {
    width: 48px;
    font-size: 1.25rem;
}

.toast-body {
    padding: 0.75rem 0;
    font-weight: 500;
}

.toast.bg-success {
    background-color: rgba(25, 135, 84, 0.95) !important;
}

.toast.bg-success .toast-icon .fa::before {
    content: "\f058";  /* Font Awesome: fa-check-circle */
}

.toast.bg-danger {
    background-color: rgba(220, 53, 69, 0.95) !important;
}

.toast.bg-danger .toast-icon .fa::before {
    content: "\f06a";  /* Font Awesome: fa-exclamation-circle */
}

.toast.bg-warning {
    background-color: rgba(255, 193, 7, 0.95) !important;
    color: #000 !important;
}

.toast.bg-warning .toast-icon .fa::before {
    content: "\f05a";  /* Font Awesome: fa-info-circle */
}

.toast .btn-close {
    filter: brightness(0) invert(1);
}

.toast.bg-warning .btn-close {
    filter: none;
} 

/* Firefox 滚动条美化 */
.menu-container,
.content-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) rgba(255,255,255,0.1);
}

.content-body {
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* 导航菜单容器 */
.nav-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* 搜索框容器 */
.search-container {
    flex-shrink: 0;
    padding: 1rem 1rem 0.5rem;
}

/* 菜单列表容器 */
.menu-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0.5rem 1rem 1rem;
}
/* 全局滚动条样式 */
* {
    scrollbar-width: thin;  /* Firefox */
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);  /* Firefox */
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-height);
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: calc(var(--scrollbar-width) / 2);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* 内容区域滚动条 */
.content-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.content-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

.content-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 暗色背景滚动条 */
.sidebar::-webkit-scrollbar-track,
.dark-theme::-webkit-scrollbar-track {
    background: var(--scrollbar-track-dark);
}

.sidebar::-webkit-scrollbar-thumb,
.dark-theme::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-dark);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.dark-theme::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover-dark);
}

/* Firefox暗色滚动条 */
.sidebar,
.dark-theme {
    scrollbar-color: var(--scrollbar-thumb-dark) var(--scrollbar-track-dark);
}

/* 响应式布局调整 */
@media (min-width: 1200px) {
    .col-xl-2 {
        flex: 0 0 auto;
        width: var(--sidebar-width-xl);
    }
}

/* Loading 动画样式 */
.loading-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    position: absolute;
    margin-top: 70px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
}

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

/* 移动端样式 */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1030;
        height: 100vh;
    }
    
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
}

/* 菜单折叠按钮样式 */
.menu-toggle {
    padding: 0.375rem;
    color: var(--primary-color);
    display: none;
    border: none;
    background: transparent;
}

.menu-toggle:hover {
    color: var(--primary-dark);
}

.menu-toggle .fa {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.menu-toggle.active .fa {
    transform: rotate(90deg);
}

/* 关闭按钮样式 */
.close-sidebar {
    color: rgba(255,255,255,0.8) !important;
    border: none;
    padding: 0.5rem !important;
    margin: -0.5rem;
}

.close-sidebar:hover {
    color: #fff !important;
    transform: rotate(90deg);
}

.close-sidebar .fa {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

/* 遮罩层 */
.sidebar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar.show::before {
    opacity: 1;
    visibility: visible;
}

/* 移动端样式 */
@media (max-width: 767.98px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1030;
        height: 100vh;
        width: 280px;
    }
}