/* 确保HTML根元素也不会出现水平滚动条 */
html {
    overflow-x: hidden;
    width: 100%;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 修复页面顶部内容被遮挡的问题 */
body {
    padding-top: 60px; /* 添加足够的顶部内边距，防止内容被固定的头部遮挡 */
}

/* 确保容器不会与页面顶部重叠 */
.container {
    position: relative;
    z-index: 1;
    padding-top: 20px; /* 额外的顶部内边距 */
}

/* 二级菜单占位符样式 - 确保正确推挤下方元素 */
.submenu-placeholder {
    display: block;
    visibility: hidden;
    clear: both;
    width: 100%;
    transition: height 0.3s ease;
    /* 确保占位符有适当的位置定位 */
    position: relative;
    z-index: 0; /* 降低z-index，避免影响其他元素 */
    pointer-events: none; /* 确保不干扰鼠标事件 */
}

/* 二级分类导航样式 */
.category-nav-item {
    position: relative;
    z-index: 1001;
    margin-bottom: 0 !important;
}

.category-nav-item.expanded {
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.nav-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    /* padding: 12px 15px; */
    cursor: pointer;
    transition: background-color 0.3s;
    box-sizing: border-box;
    margin: 0;
    border: 0;
    position: relative;
    z-index: 2001;
}

.nav-item-main:hover {
    background-color: #f5f5f5;
}

.subcategory-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.subcategory-arrow.rotate {
    transform: rotate(90deg);
}

/* 二级菜单容器样式优化 */
.subcategory-nav-container {
    /* 绝对定位，确保显示在所有元素之上 */
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    background-color: #ffffff;
    display: none;
    overflow: visible; /* 改为visible，确保内容不被裁剪 */
    opacity: 0;
    z-index: 9999 !important; /* 强制最高z-index，确保在所有元素之上 */
    width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* 添加最小宽度和最大宽度限制 */
    min-width: 240px;
    /* 确保不会被其他内容遮挡 */
    transition: opacity 0.3s ease;
    transform: translateY(0); /* 修改为0，避免初始位移 */
    /* 强制层级管理 */
    isolation: isolate; /* 创建新的层叠上下文 */
}

.subcategory-nav-container.show {
    display: block;
    opacity: 1;
    animation: slideDown 0.3s ease-out forwards;
    border-top: 1px solid #e0e0e0;
}

/* 为包含二级菜单的导航项添加标识 */
.nav-item.category-nav-item.has-subcategories {
    position: relative;
    border-radius: 8px 8px 0 0;
    background-color: #f9f9f9;
    overflow: visible !important;
    margin-bottom: 0 !important;
    padding-bottom: 0;
    z-index: 2001;
    box-sizing: border-box;
    border: 1px solid transparent;
    transition: background-color 0.3s, border-color 0.3s;
}

/* 添加关键帧动画使过渡更平滑 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subcategory-nav-item {
    display: flex;
    align-items: center;
    padding: 8px 15px 8px 35px;
    font-size: var(--font-size-small);
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    background-color: #ffffff;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 9999 !important; /* 强制最高z-index */
}

/* 修复二级菜单项中的空图标元素 */
.subcategory-nav-item .nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 12px;
    /* 移除空图标元素的背景和边框 */
    background: none;
    border: none;
    box-shadow: none;
    /* 为空图标添加透明占位，避免影响布局 */
    min-width: 24px;
}

.subcategory-nav-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.subcategory-nav-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* 确保侧边栏内容不会被固定元素遮挡 */
.sidebar-content {
    position: relative;
    z-index: 999;
}

/* 修复当多个二级菜单同时展开时的层级问题 */
.nav-item {
    position: relative;
    z-index: 1000;
    margin-bottom: 0; /* 调整为0，与折叠状态保持一致 */
}

/* 确保激活状态的导航项有适当的层级 */
.nav-item.active {
    z-index: 1001;
}

.subcategory-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #007bff; /* 使用主色调提高可见性 */
    margin-right: 8px;
}

/* AI论文工具二级菜单标签样式 */
.subcategory-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
    border-radius: 6px;
    padding: 4px;
}

.subcategory-tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: var(--font-size-normal);
    color: #666;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    font-weight: 500;
}

.subcategory-tab-btn:hover {
    background-color: #f0f0f0;
    color: #007bff;
}

.subcategory-tab-btn.active {
    background-color: white;
    color: #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 600;
}

/* AI论文工具二级分类区域特殊样式 */
.thesis-subcategory-section {
    margin-top: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.thesis-subcategory-section .subcategory-title {
    background-color: #f8f9fa;
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.thesis-subcategory-section .tools-grid {
    padding: 15px 20px;
}

/* 工具网格 - 优化为两列布局 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* 工具卡片样式优化 */
.tool-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.1);
}

/* 平板设备上保持两列布局 */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* 手机设备上单列显示 */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* 字体层级变量 */
:root {
    --font-size-large: 18px;
    --font-size-medium: 16px;
    --font-size-normal: 14px;
    --font-size-small: 12px;
    --font-size-tiny: 11px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* 防止过渡期间出现水平滚动条 */
    width: 100%;
    position: relative;
}

/* 顶部标题栏 */
.header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px 0 15px;
    height: 64px; /* 增加高度以提供更好的视觉平衡 */
    display: flex;
    align-items: center;
    justify-content: space-between; /* 增加左右部分间距 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* 用户认证样式 */
.auth-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.auth-button {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.login-button {
    background-color: transparent;
    color: #333;
    border: 1px solid #ddd;
}

.login-button:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.register-button {
    background-color: #4CAF50;
    color: white;
    border: 1px solid #4CAF50;
}

.register-button:hover {
    background-color: #45a049;
    border-color: #45a049;
}

.user-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.user-name {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    background-color: #f5f5f5;
    color: #333;
    font-weight: 500;
}

.dropdown-icon {
    margin-left: 5px;
    font-size: 12px;
    transition: transform 0.3s;
}

.user-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 120px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 14px;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-large);
    font-weight: 700; /* 加粗提升视觉权重 */
    color: #333;
}

.logo i {
    font-size: 20px;
    color: #007bff;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-item {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s;
}

.nav-item:hover {
    color: #007bff;
}

.header-right {
    display: flex;
    align-items: center;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 200px;
    padding: 8px 35px 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: var(--font-size-normal);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    width: 240px; /* 聚焦时增加宽度 */
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.search-icon {
    position: absolute;
    right: 12px;
    color: #666;
    font-size: 14px;
}

/* 搜索结果样式 */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1001;
    margin-top: 5px;
    max-height: 450px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 搜索结果头部 */
.search-results-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-results-count {
    font-weight: 500;
}

.search-results-query {
    color: #007bff;
    font-weight: 600;
}

.search-results-query mk {
    background: linear-gradient(90deg, #007bff, #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 无搜索结果样式 */
.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.search-no-results i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.search-no-results p {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
}

.search-no-results small {
    font-size: 12px;
    opacity: 0.7;
}

.search-results-list {
    padding: 8px 0;
}

/* 图标搜索组件样式 */
.icon-search-wrapper {
    width: 100%;
}

.selected-icon-section {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.selected-icon-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.selected-icon-display {
    min-height: 36px;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.selected-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-icon i {
    font-size: 18px;
    color: #007bff;
}

.no-icon {
    color: #6c757d;
    font-style: italic;
}

.icon-search-section {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.icon-search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.icon-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.icon-search-input + .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.icon-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.icon-results-container.show {
    display: block;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 15px;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 12px;
}

.icon-item:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.icon-item i {
    font-size: 24px;
    margin-bottom: 6px;
    color: #007bff;
}

.no-icons {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
}

.no-icons i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.no-icons p {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 500;
}

.no-icons small {
    font-size: 12px;
    opacity: 0.7;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 6px;
        padding: 10px;
    }
    
    .icon-item {
        padding: 8px;
        font-size: 11px;
    }
    
    .icon-item i {
        font-size: 20px;
        margin-bottom: 4px;
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    position: relative;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    border-left-color: #e9ecef;
}

.search-result-item.selected {
    background-color: #e3f2fd;
    border-left-color: #007bff;
}

.search-result-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.search-result-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.search-result-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: var(--font-size-normal);
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.search-result-description {
    font-size: var(--font-size-small);
    color: #666;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.search-result-url {
    color: #999;
    font-family: 'Courier New', monospace;
}

.search-result-score {
    display: none; /* 隐藏评分，仅用于调试 */
    font-size: 10px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* 匹配类型标签 */
.match-type {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.match-type.exact {
    background: #e8f5e8;
    color: #2e7d2e;
}

.match-type.name {
    background: #e3f2fd;
    color: #1976d2;
}

.match-type.pinyin-exact {
    background: #fff3e0;
    color: #e65100;
}

.match-type.pinyin {
    background: #ffeaa7;
    color: #d63031;
}

/* 搜索高亮样式 */
.search-highlight {
    background: linear-gradient(90deg, #fff3cd, #ffeaa7);
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
    color: #856404;
}

/* 工具卡片高亮样式 */
.highlight {
    animation: highlight-pulse 1s ease-in-out;
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.5);
    transform: scale(1.05);
    transition: all 0.3s ease;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}



/* 主容器 */
.main-container {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* 左侧导航栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    width: 190px;
    height: calc(100vh - 64px);
    background: white;
    overflow-y: auto;
    overflow-x: visible; /* 改为visible，确保二级菜单不被裁剪 */
    scrollbar-width: thin;
    scrollbar-color: #007bff #f5f5f5;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    /* 仅过渡宽度，避免触发布局抖动 */
    transition: width 0.3s ease-in-out;
    /* 保持滚动条占位，防止出现/消失导致的水平位移 */
    scrollbar-gutter: stable both-edges;
    will-change: width;
    z-index: 100;
    /* 确保侧边栏内容不会溢出 */
    box-sizing: border-box;
}

/* 侧边栏折叠状态 */
.sidebar.collapsed {
    width: 50px; /* 折叠后的宽度 */
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.05);
}

/* 顶部折叠按钮样式 */
.sidebar-toggle {
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    margin-right: 5px;
    font-size: 14px;
    position: relative;
}

.sidebar-toggle .toggle-arrow {
    font-size: 12px;
    font-weight: 600;
}

.sidebar-toggle:hover {
    background: #e8e8e8;
    transform: scale(1.05);
    color: #007bff;
}

.sidebar-toggle:hover .toggle-arrow {
    color: #007bff;
}

/* 折叠按钮箭头方向切换 */
.sidebar-toggle .toggle-arrow {
    transition: transform 0.3s ease;
}

/* 菜单展开时：箭头向左（默认状态） */
.sidebar-toggle .toggle-arrow {
    transform: rotate(0deg);
}

/* 菜单折叠时：箭头向右 */
body.sidebar-collapsed .sidebar-toggle .toggle-arrow {
    transform: rotate(180deg);
}

/* 左侧导航栏滚动条样式 - Webkit浏览器 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #007bff;
}

.sidebar-nav {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    gap: 10px;
    overflow: hidden;
    min-height: 40px;
    box-sizing: border-box;
    margin-bottom: 0;
}

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

.sidebar-nav .nav-item.active {
    background-color: #e3f2fd;
    color: #007bff;
}

.sidebar-nav .nav-item span {
    flex: 1;
    font-size: 14px;
    transition: all 0.3s ease;
    /* 防止覆盖右侧箭头 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0;
    min-width: 0; /* 关键：允许文本在flex容器中占满剩余空间 */
    display: block;
}

/* 侧边栏折叠状态下的导航项文本隐藏 - 超级严格模式 */
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item > span,
.sidebar.collapsed .nav-item:hover span,
.sidebar.collapsed .nav-item:focus span {
    display: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    animation: none !important;
    -webkit-animation: none !important;
    z-index: -1 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: transparent !important;
}

/* 确保折叠状态下图标居中显示 */
.sidebar.collapsed .nav-item {
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 0;
    gap: 0;
}

/* 已在上方整合到.nav-icon基类和侧边栏折叠样式中 */

/* 侧边栏导航容器 - 居中对齐 */
.sidebar.collapsed .sidebar-nav {
    padding: 10px 0;
    align-items: center;
}

/* 侧边栏展开状态下的导航项样式 */
.sidebar:not(.collapsed) .nav-item span {
    display: block !important;
    opacity: 1 !important;
    width: auto !important;
    visibility: visible !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    position: relative !important;
    z-index: 9999 !important;
    flex: 1 !important;
    margin: 0 !important;
    padding-right: 8px !important;
    pointer-events: auto !important;
    min-width: 100px !important;
    max-width: 200px !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
    color: #333 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -moz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -ms-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 确保侧边栏展开状态下的导航项容器有足够空间 */
.sidebar:not(.collapsed) .nav-item {
    justify-content: flex-start !important;
    padding: 8px 16px !important;
    gap: 10px !important;
    overflow: visible !important;
    width: 100% !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    position: relative !important;
}

/* 确保侧边栏导航容器有足够空间 */
.sidebar:not(.collapsed) .sidebar-nav {
    width: 100% !important;
    overflow: visible !important;
    padding: 10px 0 !important;
    align-items: flex-start !important;
    height: 100% !important;
}

/* 确保二级菜单也能正确显示文本 */
.sidebar:not(.collapsed) .nav-dropdown .nav-dropdown-items .nav-item span {
    display: block !important;
    opacity: 1 !important;
    width: auto !important;
    visibility: visible !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    position: relative !important;
    z-index: 9999 !important;
}

/* 确保收藏夹项也能正确显示文本 */
.sidebar:not(.collapsed) .favorites-nav .nav-item span {
    display: block !important;
    opacity: 1 !important;
    width: auto !important;
    visibility: visible !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    position: relative !important;
    z-index: 9999 !important;
}

/* 搜索结果点击定位时的悬停状态样式 - 为标签页提供明显视觉反馈 */
.tab-btn.hover,
.nav-item.hover,
.tool-card.hover,
.search-result-item.hover {
    background-color: #e3f2fd !important;
    border-color: #007bff !important;
    color: #007bff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
    transition: all 0.3s ease;
}

/* 为侧边栏导航项的悬停状态添加额外样式 */
.sidebar-nav .nav-item.hover {
    border-left: 3px solid #007bff;
    background-color: #e3f2fd !important;
}

/* 为工具卡片的悬停状态添加额外样式 */
.tool-card.hover {
    border: 2px solid #007bff;
}

/* 为搜索结果项的悬停状态添加额外样式 */
.search-result-item.hover {
    border-left-color: #007bff;
    background-color: #e3f2fd !important;
}

/* 为标签按钮的悬停状态添加额外样式 */
.subcategory-tab-btn.hover {
    background-color: #e3f2fd !important;
    color: #007bff !important;
    font-weight: 600;
}

/* 添加fadeIn动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 确保侧边栏展开时的导航容器布局正确 */
.sidebar:not(.collapsed) .sidebar-nav {
    padding: 10px 0 !important;
    align-items: flex-start !important;
    width: 100%;
}

/* 修复可能的过渡动画问题 */
.sidebar-nav .nav-item span {
    transition: all 0.3s ease !important;
    /* 确保在任何状态下都不被隐藏 */
    animation: fadeIn 0.3s ease-out !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* JavaScript实现的悬停提示样式 */
.nav-tooltip {
    position: absolute;
    left: 100%;
    margin-left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 80px;
    text-align: center;
    visibility: hidden;
}

.nav-tooltip-arrow {
    position: absolute;
    left: 100%;
    margin-left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1001;
    visibility: hidden;
}

/* 添加悬停时的图标高亮效果 */
.sidebar.collapsed .sidebar-nav .nav-item:hover .nav-icon {
    background: #007bff !important;
    color: white !important;
    transform: scale(1.1);
}

/* 确保侧边栏内容区域完全紧凑 */
.sidebar.collapsed {
    overflow: visible;
    padding-bottom: 0;
    height: calc(100vh - 64px);
}


/* 确保导航图标在展开和折叠状态下位置一致 */
.nav-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f8f9fa;
    color: #666;
    flex-shrink: 0;
    margin-right: 8px;
    position: relative;
    box-sizing: border-box;
    transition: all 0.3s ease;
    line-height: 1;
    text-align: center;
}

/* 确保嵌套的Font Awesome图标也能正确显示 */
.nav-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: inherit;
    position: relative;
}

/* 侧边栏折叠时调整图标位置 - 统一处理 */
.sidebar.collapsed .nav-icon {
    margin-right: 0;
    margin-left: 0;
    margin-right: 0;
    transition: all 0.3s ease;
}

.sidebar-nav .nav-item.active .nav-icon {
    color: #007bff;
}

.sidebar-nav .nav-item i.fa-chevron-right {
    /* 作为独立flex项，位于图标与文字之间 */
    position: static;
    margin-right: 8px;
    font-size: 12px;
    color: #bbb;
    pointer-events: none;
    flex: 0 0 auto;
}

/* 折叠态隐藏箭头，避免占位与闪动 */
.sidebar.collapsed .nav-item i.fa-chevron-right {
    display: none;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 190px; /* 与调整后的侧边栏宽度匹配 */
    padding: 16px; /* 减少内边距使内容更紧凑 */
    background: #f5f5f5;
    /* 确保主内容区域可以完整滚动查看所有分类 */
    min-height: calc(100vh - 64px);
    transition: margin-left 0.3s ease-in-out;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 侧边栏折叠时调整主内容区域 */
/* 使用body状态类，确保无论DOM结构如何，折叠时主内容都会让位 */
body.sidebar-collapsed .main-content {
    margin-left: 50px !important;
}

/* —— 侧边栏稳定布局与图标对齐增强 —— */
/* 使用两列网格：固定图标列 + 文本列，折叠时文本列宽度为0，图标不会位移 */
.sidebar-nav .nav-item {
    display: grid;
    /* 固定图标列 + 可伸缩文本列，避免文本列被压缩过小导致竖排 */
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
}

/* 侧边栏折叠时调整导航项网格布局 - 确保图标居中 */
.sidebar.collapsed .sidebar-nav .nav-item {
    grid-template-columns: 40px 0fr;
    justify-items: center;
}

/* 折叠时调整文本显示，使用opacity而不是display:none，确保切换更平滑 */
.sidebar .nav-item span {
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* 展开态下强制文本单行横向排列并溢出省略，防止中文逐字换行 */
.sidebar:not(.collapsed) .sidebar-nav .nav-item span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    opacity: 1;
    visibility: visible;
}

/* 图标列始终固定，确保在折叠状态下图标完全居中 */
.sidebar.collapsed .nav-icon {
    margin: 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 分类内容区域高亮样式 */
.category-section {
    transition: all 0.3s ease;
}

.category-section.highlighted {
    box-shadow: 0 0 0 2px #007bff;
    transform: translateY(-2px);
}

/* 分类标题样式增强 - 确保图标和标题水平排列 */
.category-header {
    display: block;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

/* 强制.category-header中的所有直接子元素水平排列 */
.category-header > * {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 10px !important;
}

/* 分类图标样式增强 - 确保图标容器正确显示 */
.category-header .category-icon {
    width: 30px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #666 !important;
    vertical-align: middle !important;
}

/* 确保图标本身也正确对齐 */
.category-header .category-icon i {
    font-size: inherit !important;
    color: inherit !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.category-section.highlighted .category-header {
    border-bottom-color: #007bff;
}

.content-section {
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 标签页 */
.section-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: var(--font-size-normal);
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #007bff; /* 使用主蓝色代替红色 */
    border-bottom-color: #007bff;
}

/* 工具滚动区域 */
.tools-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    min-width: 120px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tool-item:hover {
    background: #e9ecef;
}

.tool-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
}

.tool-name {
    font-size: var(--font-size-small);
    color: #333;
    flex: 1;
}

.tool-item i {
    font-size: 10px;
    color: #ccc;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px; /* 减少卡片间距使布局更紧凑 */
}

.tool-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px; /* 增加卡片内边距 */
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tool-card:hover {
    border-color: #007bff;
    transform: translateY(-2px); /* 添加轻微上浮效果 */
    box-shadow: 0 6px 16px rgba(0,123,255,0.15); /* 增强阴影 */
}

/* 拖拽反馈样式 */
.tool-card.dragging {
    opacity: 0.6;
    transform: scale(0.98);
}

.tools-grid.drop-target {
    outline: 2px dashed #007bff;
    outline-offset: 4px;
}

.tool-card.drop-placeholder {
    border: 2px dashed #007bff;
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tool-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.tool-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.tool-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.tool-card-name {
    font-size: var(--font-size-normal);
    font-weight: 600;
    color: #333;
    flex: 1;
}

.tool-card-arrow {
    font-size: 12px;
    color: #ccc;
}

.tool-card-description {
    font-size: var(--font-size-small);
    color: #666;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.2s ease;
}

.tool-card-description:hover {
    color: #333;
}

/* 分类标题 */
.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.category-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
}

.category-header .category-icon i {
    font-size: inherit;
    color: inherit;
}

.category-header h2 {
    font-size: var(--font-size-medium);
    font-weight: 600;
    color: #333;
}

/* 回到顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: #666;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-top:hover {
    background: #333;
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */

/* 平板设备优化 */
@media (max-width: 1024px) {
    .sidebar {
        width: 160px;
    }
    
    .main-content {
        margin-left: 160px;
        padding: 20px;
    }
    
    .category-section.highlighted {
        transform: translateY(-1px);
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    /* 平板设备上保持适当间距 */
    .header {
        justify-content: space-between;
    }
    
    .header-left {
        gap: 20px;
    }
    
    .search-input {
        width: 180px;
    }
}

/* 手机设备优化 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* 默认隐藏 */
    }
    
    .sidebar.active {
        transform: translateX(0); /* 激活时显示 */
    }
    
    .main-content {
        margin-left: 0;
    }
    
    /* 移动端菜单按钮 */
    .sidebar-toggle {
        display: flex;
        margin-right: 10px;
        cursor: pointer;
        font-size: 20px;
        color: #333;
    }
    
    /* 优化搜索框宽度 */
    .search-input {
        width: 150px;
    }
    
    /* 优化滚动通知 */
    .marquee-container {
        display: none; /* 在极小屏幕上隐藏滚动通知 */
    }
    
    /* 移动端header布局优化 */
    .header {
        justify-content: space-between;
    }
    
    .header-left {
        gap: 15px;
    }
    
    .nav-menu {
        gap: 10px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* 个人中心页面样式 */
.user-profile-info {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    padding: 20px;
    background-color: #fafafa;
    border-radius: 8px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #666;
    flex-shrink: 0;
}

.profile-details {
    flex: 1;
}

.info-item {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.info-item label {
    font-weight: 600;
    color: #666;
    width: 100px;
    flex-shrink: 0;
}

.info-item span {
    color: #333;
    font-size: var(--font-size-normal);
}

/* 密码表单样式 */
.password-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: var(--font-size-normal);
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

.submit-button {
    padding: 10px 24px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: var(--font-size-normal);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #0056b3;
}

.submit-button:active {
    transform: translateY(1px);
}

/* 个人中心导航样式增强 */
.category-section[data-category="profile"],
.category-section[data-category="favorites"],
.category-section[data-category="password"] {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 侧边栏当前页高亮 */
.sidebar-nav .nav-item.active {
    background-color: #e3f2fd;
    color: #007bff;
}

.sidebar-nav .nav-item.active .nav-icon {
    color: #007bff;
}

/* 下拉菜单当前项高亮 */
.dropdown-item.active {
    background-color: #e3f2fd;
    color: #007bff;
}

/* 提示框样式 */
#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .user-profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .profile-details {
        width: 100%;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 12px;
    }
    
    .info-item label {
        width: auto;
        margin-bottom: 4px;
    }
    
    .password-form {
        padding: 10px;
    }
    
    .form-actions {
        justify-content: center;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #007bff;
    opacity: 0.3;
    border-radius: 4px;
    transition: opacity 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
    opacity: 0.8;
}

/* 收藏网格布局 - 与普通工具网格布局保持一致 */
.favorites-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    position: relative;
}

/* 确保卡片有适当的样式 */
.favorites-grid-layout .tool-card {
    /* 保持与普通卡片相同的样式，继承所有默认样式 */
    display: flex;
    flex-direction: column;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 1024px) {
    .favorites-grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
}

/* 响应式设计 - 手机设备 */
@media (max-width: 768px) {
    .favorites-grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

/* 收藏按钮样式 */
.favorite-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
}

.favorite-btn:hover {
    background: rgba(0,0,0,0.1);
    color: #ffd700;
    transform: scale(1.1);
}

.favorite-btn.favorited {
    color: #ffd700;
}

.favorite-btn.favorited:hover {
    color: #ccc;
}

/* 空收藏状态样式 */
.empty-favorites {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-favorites i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-favorites p {
    font-size: var(--font-size-normal);
    margin-bottom: 8px;
}

.empty-favorites small {
    font-size: var(--font-size-small);
    color: #999;
}

/* AI论文工具二级菜单紧凑样式 */
.thesis-tabs-compact {
    display: flex;
    gap: 0; /* 移除标签之间的间隙 */
    margin-bottom: 16px; /* 减少底部边距 */
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 6px;
    padding: 2px;
}

.thesis-tab-btn {
    background: none;
    border: none;
    padding: 8px 16px; /* 减少内边距使标签更紧凑 */
    cursor: pointer;
    font-size: 14px; /* 使用稍小的字体 */
    color: #666;
    border-radius: 4px; /* 添加圆角 */
    margin: 0 1px;
    transition: all 0.2s ease;
    flex: 1; /* 平均分配宽度 */
    text-align: center;
}

.thesis-tab-btn:hover {
    background: #e8f4fd;
    color: #007bff;
}

.thesis-tab-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

/* 二级分类内容区域样式 */
.thesis-subcategory-section {
    transition: all 0.3s ease;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .thesis-tabs-compact {
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .thesis-tab-btn {
        flex: 1 1 45%; /* 移动端每行显示两个标签 */
        min-width: 120px;
    }
}

/* 滚动通知样式 */
.marquee-container {
    background-color: #e3f2fd; /* 使用更柔和的蓝色调 */
    border: 1px solid #bbdefb;
    padding: 4px 10px;
    border-radius: 4px;
    overflow: hidden;
    white-space: nowrap;
    flex: 0.5; /* 减少滚动通知区域比例，给搜索框更多空间 */
    margin: 0 15px; /* 调整边距 */
}

.marquee {
    display: inline-block;
    animation: marquee 20s linear infinite;
}

.marquee span {
    color: #1565c0; /* 深蓝色文本提升可读性 */
}

@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 加载指示器样式 */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4A90E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-indicator.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 菜单数据加载状态 */
.menu-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* 菜单数据加载错误 */
.menu-error {
    padding: 20px;
    text-align: center;
    color: #e74c3c;
    background-color: #fadbd8;
    border-radius: 8px;
    margin: 20px;
}

/* 工具卡片描述悬停提示样式 */
.tool-card-description-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 300px;
    white-space: normal;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    margin-bottom: 8px;
    word-wrap: break-word;
    line-height: 1.4;
}

.tool-card-description-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.tool-card-description:hover .tool-card-description-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 导航项拖拽样式 */
.nav-item-draggable {
    cursor: move;
}

.nav-item-dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
}

.nav-drop-target {
    background-color: #f0f8ff !important;
    border: 2px dashed #007bff !important;
}

.nav-drop-placeholder {
    height: 3px;
    background: #007bff;
    border-radius: 2px;
    margin: 2px 8px;
    opacity: 0.8;
    transition: all 0.2s ease;
}
