/* 统一通用样式 - 基于AI工具集设计 */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
}

/* 顶部导航栏 */
.navbar-top {
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--primary-hover);
}

.navbar-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.navbar-nav .nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* 左侧边栏容器 */
.sidebar-container {
    position: relative;
    padding-right: 1rem;
}

/* 折叠面板容器 - 左右伸缩设计 */
.sidebar-collapse-panel {
    background-color: var(--bg-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 100px;
    left: 0.5rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    /* 展开状态：240px */
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    /* 流畅的左右伸缩动画 */
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

/* 折叠状态下隐藏滚动条，内容不滚动 */
.sidebar-collapse-panel.collapsed {
    overflow: hidden;
    /* 确保内容不超出容器 */
}

/* 折叠状态下隐藏滚动条样式 */
.sidebar-collapse-panel.collapsed::-webkit-scrollbar {
    display: none;
}

.sidebar-collapse-panel.collapsed {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 面板头部 */
.collapse-panel-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    border-radius: 8px 8px 0 0;
    /* 只在面板折叠/展开时才有transition，子菜单展开时不影响头部 */
    transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                justify-content 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    /* 固定高度防止闪动 */
    height: 3.75rem;
    min-height: 3.75rem;
    max-height: 3.75rem;
    /* 确保头部位置固定，不受子菜单展开影响 */
    position: relative;
    z-index: 10;
}

/* 面板主体 */
.collapse-panel-body {
    padding: 1.5rem;
    transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    /* 允许悬浮菜单溢出显示 */
    overflow: visible;
}

/* 折叠面板切换按钮 */
.collapse-panel-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s;
    border-radius: 6px;
    line-height: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.collapse-panel-toggle:hover {
    transform: scale(1.1);
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.collapse-panel-toggle i {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    display: inline-block;
}

/* 面板标题 */
.collapse-panel-title {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    /* 只在面板折叠/展开时才有transition，子菜单展开时不影响标题 */
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-width: 100%;
    /* 确保标题位置固定 */
    flex-shrink: 1;
    min-width: 0;
}

/* 折叠面板状态 - 向左收缩 */
.sidebar-collapse-panel.collapsed {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
}

/* 折叠时按钮图标旋转180度（左箭头变为右箭头） */
.sidebar-collapse-panel.collapsed .collapse-panel-toggle i {
    transform: rotate(180deg);
}

/* 展开时按钮图标保持0度（右箭头） */
.sidebar-collapse-panel:not(.collapsed) .collapse-panel-toggle i {
    transform: rotate(0deg);
}

/* 折叠状态下调整面板主体 */
.sidebar-collapse-panel.collapsed .collapse-panel-body {
    padding: 0.75rem 0.5rem;
}

/* 折叠状态下隐藏面板标题文字 */
.sidebar-collapse-panel.collapsed .collapse-panel-title {
    opacity: 0;
    max-width: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* 折叠状态下头部居中显示 */
.sidebar-collapse-panel.collapsed .collapse-panel-header {
    justify-content: center;
    padding: 1rem 0.5rem;
    /* 保持固定高度防止闪动 */
    height: 3.75rem;
}

/* 折叠状态下隐藏展开/收缩按钮 */
.sidebar-collapse-panel.collapsed #expandAllBtn,
.sidebar-collapse-panel.collapsed #collapseAllBtn {
    display: none !important;
}

/* 展开所有子栏目按钮 */
.sidebar-expand-all-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0 !important;
    /* 移除transition，避免按钮切换时的动画 */
    transition: none;
    /* 确保按钮显示/隐藏不影响布局 */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
    line-height: 1;
    /* 确保图标居中 */
    text-align: center;
}

/* 展开所有子栏目按钮内的图标 */
.sidebar-expand-all-btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
}

/* 收缩所有子栏目按钮 */
.sidebar-collapse-all-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0 !important;
    /* 移除transition，避免按钮切换时的动画 */
    transition: none;
    /* 确保按钮显示/隐藏不影响布局 */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
    line-height: 1;
    /* 确保图标居中 */
    text-align: center;
}

/* 收缩所有子栏目按钮内的图标 */
.sidebar-collapse-all-btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
}

/* 按钮隐藏时使用visibility，保持占用空间避免布局跳动 */
.sidebar-expand-all-btn.d-none,
.sidebar-collapse-all-btn.d-none {
    display: none !important;
}

/* 展开状态 - 向右展开 */
.sidebar-collapse-panel:not(.collapsed) .collapse-panel-body {
    opacity: 1;
}

.sidebar-collapse-panel:not(.collapsed) .collapse-panel-title {
    opacity: 1;
    max-width: 100%;
    width: auto;
}

/* 展开状态下隐藏折叠菜单的悬浮层 */
.sidebar-collapse-panel:not(.collapsed) .collapsed-menu-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 菜单按钮样式 - 统一基础样式 */
.sidebar-menu-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    position: relative;
    border: none;
    background: none;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.sidebar-menu-toggle-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.sidebar-menu-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* 折叠状态下，菜单按钮禁用Bootstrap collapse的点击行为 */
.sidebar-collapse-panel.collapsed .sidebar-menu-toggle-btn[data-bs-toggle="collapse"] {
    pointer-events: auto;
}

/* 子菜单样式 - 配合Bootstrap 5 collapse */
.sidebar-submenu {
    list-style: none;
    padding-left: 0;
    margin: 0;
    /* 确保collapse内容可见 */
    display: block;
}




/* 响应式：移动端取消固定定位 */
@media (max-width: 991.98px) {
    .sidebar-collapse-panel {
        position: static;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        max-height: none;
    }

    .sidebar-collapse-panel.collapsed {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .sidebar-container {
        padding-right: 0;
    }
}

.sidebar-category {
    margin-bottom: 1.5rem;
    transition: margin-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    /* 固定最小高度防止闪动 */
    min-height: 2.5rem;
}

.sidebar-category-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                margin-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    overflow: hidden;
}

/* 折叠状态下隐藏分类标题 */
.sidebar-collapse-panel.collapsed .sidebar-category-title {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
}

.sidebar-collapse-panel.collapsed .sidebar-category {
    margin-bottom: 0.75rem;
    /* 折叠状态下保持最小高度防止闪动 */
    min-height: 2.5rem;
}

.sidebar-menu {
    list-style: none;
    /* 确保悬浮菜单不被裁剪 */
    overflow: visible;
}

.sidebar-menu-item {
    margin-bottom: 0.5rem;
    /* 确保悬浮菜单不被裁剪 */
    overflow: visible;
    /* 固定最小高度防止闪动 */
    min-height: 2.5rem;
    transition: min-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
    position: relative;
}

.sidebar-menu-text {
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: inline-block;
    overflow: hidden;
    opacity: 1;
    max-width: 200px;
}

.sidebar-menu-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.sidebar-menu-link.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* 子菜单链接激活状态 */
.sidebar-submenu-link.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    font-weight: 500;
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 子菜单样式 */
.sidebar-menu-item.has-submenu {
    position: relative;
    /* 确保悬浮菜单不被裁剪 */
    overflow: visible;
}

.sidebar-menu-toggle {
    cursor: pointer;
}

/* 菜单项包装器 */
.menu-item-wrapper {
    position: relative;
    /* 确保悬浮菜单可以正确显示 */
    z-index: 1;
    /* 折叠状态下确保有足够的空间显示悬浮菜单 */
    overflow: visible;
}

/* 折叠状态下，菜单项包装器hover或active时提升层级 */
.sidebar-collapse-panel.collapsed .menu-item-wrapper:hover,
.sidebar-collapse-panel.collapsed .menu-item-wrapper.active {
    z-index: 1051;
}



/* 折叠状态下，完全禁用子菜单的下拉展开效果 */
.sidebar-collapse-panel.collapsed .collapse {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

.sidebar-collapse-panel.collapsed .collapse.show {
    display: none !important;
}

/* 折叠状态下，菜单项包装器需要明确的定位上下文 */
.sidebar-collapse-panel.collapsed .menu-item-wrapper {
    position: relative;
    overflow: visible;
    /* 确保包装器宽度与按钮一致 */
    width: 100%;
    /* 固定最小高度防止闪动 */
    min-height: 2.5rem;
    transition: min-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 移除重复的菜单按钮样式定义，已在上面统一定义 */

/* 折叠状态下的菜单按钮样式 - 只显示图标 */
.sidebar-collapse-panel.collapsed .sidebar-menu-toggle-btn {
    justify-content: center;
    padding: 0.75rem;
    gap: 0;
    /* 折叠状态下，按钮宽度固定为70px */
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    /* 确保只显示图标，文字和箭头完全隐藏 */
    position: relative;
}

/* 折叠时隐藏文字和箭头，使用平滑过渡 */
.sidebar-collapse-panel.collapsed .sidebar-menu-text {
    opacity: 0;
    max-width: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-collapse-panel.collapsed .sidebar-menu-arrow {
    opacity: 0;
    max-width: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-collapse-panel.collapsed .sidebar-menu-icon {
    font-size: 1.2rem;
    transition: font-size 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 展开时显示文字和箭头 */
.sidebar-collapse-panel:not(.collapsed) .sidebar-menu-text {
    opacity: 1;
    max-width: 200px;
    width: auto;
}

.sidebar-collapse-panel:not(.collapsed) .sidebar-menu-arrow {
    opacity: 1;
    max-width: 16px;
    width: 16px;
}

/* 悬浮菜单的显示控制 - 初始隐藏状态（折叠时） */
.sidebar-collapse-panel.collapsed .collapsed-menu-overlay {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(-10px);
    pointer-events: none;
}

/* 悬浮菜单的显示控制 - hover时显示 */
.sidebar-collapse-panel.collapsed .menu-item-wrapper:hover .collapsed-menu-overlay,
.sidebar-collapse-panel.collapsed .menu-item-wrapper.active .collapsed-menu-overlay {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

/* 鼠标移动到悬浮菜单上时保持显示 */
.sidebar-collapse-panel.collapsed .collapsed-menu-overlay:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

/* 折叠状态下的悬浮菜单 - 使用fixed定位浮动在屏幕右侧 */
.collapsed-menu-overlay {
    position: fixed;
    /* 使用fixed定位，相对于视口定位，不受页面滚动影响 */
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    /* 只对opacity和visibility使用transition，left和top不使用transition，确保位置固定 */
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    pointer-events: none;
    backdrop-filter: blur(8px);
    white-space: normal;
    overflow: visible;
    display: block;
    /* 初始位置，通过JavaScript动态计算，不使用transition */
    left: 0;
    top: 0;
    transform: translateX(-10px);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    /* 确保left和top位置不受transition影响 */
    transition-property: opacity, visibility, transform;
}

.collapsed-menu-overlay::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--bg-primary);
    z-index: 1051;
    filter: drop-shadow(-2px 0 2px rgba(0, 0, 0, 0.1));
}

/* 移除重复的规则，已在上面统一定义 */

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateX(-20px) scale(0.95);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-50%) translateX(2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) translateX(8px) scale(1);
    }
}

.overlay-content {
    padding: 1rem;
    position: relative;
}

.overlay-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overlay-title i {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.collapsed-menu-overlay .sidebar-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.collapsed-menu-overlay .sidebar-submenu li {
    margin-bottom: 0.25rem;
}

.collapsed-menu-overlay .sidebar-submenu-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: block;
    color: var(--text-primary);
    position: relative;
    margin-bottom: 2px;
    cursor: pointer;
    /* 确保链接可以点击 */
    pointer-events: auto;
}

.collapsed-menu-overlay .sidebar-submenu-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.collapsed-menu-overlay .sidebar-submenu-link:active {
    transform: translateX(2px);
}

.collapsed-menu-overlay .sidebar-submenu-link.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.sidebar-menu-arrow {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-menu-arrow i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg);
}

.sidebar-menu-item.has-submenu.active .sidebar-menu-arrow {
    transform: rotate(180deg);
}


.sidebar-submenu li {
    margin-bottom: 0.25rem;
}

.sidebar-submenu-link {
    display: block;
    padding: 0.5rem 0.75rem 0.5rem 2.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.sidebar-submenu-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    padding-left: 3rem;
}

.sidebar-submenu-link.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* 主内容区 */
.main-content {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    min-height: 600px;
}

/* 主内容包装器 - 用于flex布局，让footer在右侧内容区域底部显示，独立滚动 */
.main-content-wrapper {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-secondary);
}

/* Webkit浏览器滚动条样式 */
.main-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.main-content-wrapper::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.main-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.main-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 左侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.tool-page-content {
    flex: 1;
    min-height: 0;
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 2rem;
    padding-bottom: 3rem;
    box-shadow: var(--shadow-sm);
    /* 确保按钮等元素不被遮挡，有足够的底部空间 */
    overflow: visible;
}

/* 右侧内容区容器 - 自适应宽度布局 */
.main-content-container {
    padding-left: 1rem;
    /* 使用calc计算宽度，自适应剩余空间 */
    width: calc(100% - 248px);
    margin-left: 248px;
    /* 同步的左右伸缩动画 */
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    /* 确保内容不溢出 */
    box-sizing: border-box;
}

/* 折叠状态下，右侧内容区域自适应更宽的宽度（通过JavaScript添加类） */
.sidebar-collapsed .main-content-container {
    width: calc(100% - 86px);
    margin-left: 86px;
}

/* 响应式：移动端取消左侧边距 */
@media (max-width: 991.98px) {
    .main-content-container {
        padding-left: 0;
        margin-left: 0 !important;
    }
}

/* 搜索栏 */
.search-section {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.search-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-tab {
    padding: 0.5rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.search-tab:hover {
    color: var(--primary-color);
}

.search-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-btn:hover {
    background: var(--primary-hover);
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.search-engine-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.search-engine-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.search-engine-link.active {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

/* 搜索结果容器 */
.search-results-container {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    max-width: 600px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 1000;
}

.search-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bg-secondary);
}

.search-result-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
}

.search-result-keyword {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-notes {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-arrow {
    flex-shrink: 0;
    margin-left: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    transition: all 0.2s;
}

.search-result-item:hover .search-result-arrow {
    color: var(--primary-color);
    transform: translateX(2px);
}

/* 搜索暂无结果和热门搜索标题样式 */
.search-result-item.search-no-result,
.search-result-item.search-hot-title {
    cursor: default;
    background-color: var(--bg-secondary);
}

.search-result-item.search-no-result:hover,
.search-result-item.search-hot-title:hover {
    background-color: var(--bg-secondary);
}

.search-result-item.search-no-result .search-result-keyword,
.search-result-item.search-hot-title .search-result-keyword {
    color: var(--text-secondary);
    font-weight: 400;
}

.search-result-item.search-no-result .search-result-arrow,
.search-result-item.search-hot-title .search-result-arrow {
    display: none;
}

/* 工具卡片 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.tool-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.tool-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tool-card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* 热门工具标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.section-title-icon {
    color: var(--primary-color);
}

/* 页脚 - 在右侧内容区域显示，不采用固定形式 */
.footer {
    background: linear-gradient(180deg, #f8f9ff 0%, #f0f2ff 50%, #e8ebff 100%);
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    padding: 2.5rem 1rem;
    margin-top: 2rem;
    text-align: center;
    color: var(--text-primary);
    font-size: 0.875rem;
    flex-shrink: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 -2px 12px rgba(99, 102, 241, 0.08);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--secondary-color), transparent);
    border-radius: 2px;
    opacity: 0.6;
}

.footer-content {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    text-align: center;
}

.footer-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    position: relative;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
}

.footer-link:hover {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.footer-copyright {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 400;
}

.footer-copyright p {
    margin: 0.5rem 0;
    text-align: center;
    line-height: 1.8;
}

.footer-copyright a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    padding-bottom: 2px;
}

.footer-copyright a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 导航栏切换按钮 */
.navbar-toggler {
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    background: transparent;
    border-radius: 4px;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: none;
}

.navbar-toggler-icon i {
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* 表单样式 */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* 工具页面样式 */
.tool-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* tool-page-content样式已在上面定义，此处删除重复定义 */

.sidebar-menu {
    padding-left: 0px;
}

/* =========================================
   Homepage Redesign Styles
   ========================================= */

/* Hero Section */
.home-hero {
    background: transparent;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-tab {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.search-tab:hover {
    color: var(--primary-color);
}

.search-tab.active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: var(--text-primary);
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 1px solid transparent;
    background-color: #f3f4f6;
    border-radius: 16px;
    transition: all 0.2s;
}

.search-input:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-btn:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary-color);
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: rgba(255,255,255,0.5);
}

/* Banner Card */
.banner-card {
    transition: all 0.3s ease;
}

.banner-card:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
}

/* New Tool Card */
.tool-card-new {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tool-card-new:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md) !important;
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* Update Sidebar for cleaner look */
.sidebar {
    background-color: transparent;
    box-shadow: none;
    padding-left: 0;
}


/* Main Content Background */
.main-content-container {
    background-color: #f9fafb; /* Ensure light gray background for contrast */
}

.main-content-wrapper {
    padding: 1rem;
}

/* 去除a默认样式 */
a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   页面标题区域
   ============================================ */
.tool-page-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    padding: 0.5rem 0;
}

.tool-page-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 40%, #f093fb 80%, #667eea 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: inline-block;
    position: relative;
    animation: gradient-shift 3s ease infinite;
    letter-spacing: -0.02em;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.tool-page-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #667eea, #764ba2, transparent);
    border-radius: 2px;
    animation: underline-expand 1s ease-out;
}

@keyframes underline-expand {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 80px;
        opacity: 1;
    }
}

.tool-page-header .text-muted {
    font-size: 0.95rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
    color: var(--text-secondary);
    animation: fade-in-up 0.6s ease-out 0.2s both;
}

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

/* ============================================
   代码编辑器容器
   ============================================ */
.editor-wrapper-container {
    margin-bottom: 1.5rem;
}

.editor-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.editor-label:hover {
    color: var(--go-primary);
}

.editor-label i {
    color: var(--go-primary);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.editor-label:hover i {
    transform: rotate(15deg) scale(1.1);
}

.editor-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.editor-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--go-primary), var(--go-secondary), var(--go-accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.editor-wrapper:hover::before {
    opacity: 1;
}

.editor-wrapper:hover {
    box-shadow: var(--go-shadow-lg);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-4px);
}

/* ============================================
   公共分页样式
   ============================================ */
.pagination-wrapper {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    font-size: 0.9rem;
}

.pagination .page-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.pagination .page-item.active .page-link:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #e9ecef;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

/* 响应式分页 */
@media (max-width: 575.98px) {
    .pagination {
        gap: 0.15rem;
    }
    
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        min-width: 36px;
    }
}
