/**
 * 书上上签 - 全局样式表
 * 现代化设计 - 严格遵循浅色系配色
 */

/* 阿里图标通用样式 */
.icon {
    width: 1em !important;
    height: 1em !important;
    vertical-align: -0.15em !important;
    fill: currentColor !important;
    overflow: hidden !important;
    display: inline-block !important;
}

svg.icon {
    width: 1em !important;
    height: 1em !important;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, '微软雅黑', sans-serif;
    font-size: 14px;
    color: #333333;
    background-color: #FFFFFF;
    overflow: hidden;
    line-height: 1.6;
}

/* 页面主容器 */
.main-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 60px); /* 减去顶栏高度 */
    margin-top: 60px; /* 为顶栏留出空间 */
}

/* 左侧侧边栏 - 固定定位 */
.sidebar {
    position: fixed;
    top: 60px; /* 从顶栏下方开始 */
    left: 0;
    width: 240px;
    height: calc(100vh - 60px); /* 减去顶栏高度 */
    background: #F8F9FA;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
    border-right: 1px solid #E8E8E8;
    overflow-x: visible;
    z-index: 1000; /* 低于顶栏的1001 */
}

/* LOGO区域 - PC端隐藏，移动端显示 */
.sidebar-logo {
    height: 75px;
    display: none; /* PC端默认隐藏侧边栏LOGO */
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #FFFFFF;
    padding: 5px 20px;
}

.sidebar-logo img {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* 分类显示区域 */
.sidebar-categories {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    padding: 16px 0;
}

.sidebar-categories::-webkit-scrollbar {
    width: 4px;
}

.sidebar-categories::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-categories::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    transition: background-color 0.3s;
}

.sidebar-categories::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* 一级分类 - 现代化 */
/* 分类容器 */
.category-wrapper {
    margin: 0;
    overflow: visible;
}

.category-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 2px 12px;
    border-radius: 8px;
    position: relative;
    overflow: visible;
}

/* 折叠/展开图标 */
.category-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-toggle .icon {
    font-size: 14px;
    color: #999999;
    transition: transform 0.3s ease;
    transform: rotate(0deg); /* 默认收起状态，图标向右 */
}

.category-toggle:hover {
    background: rgba(24, 144, 255, 0.1);
}

.category-toggle:hover .icon {
    color: #1890FF;
}

/* 展开状态时图标向下 */
.category-wrapper:not(.collapsed) .category-toggle .icon {
    transform: rotate(90deg);
}

.category-wrapper.collapsed .sub-categories {
    max-height: 0;
    overflow-y: hidden;
    overflow-x: visible;
}

/* 手动锁定状态的图标颜色 */
.category-wrapper[data-manual-state="expanded"] .category-toggle .icon,
.category-wrapper[data-manual-state="collapsed"] .category-toggle .icon {
    color: #1890FF;
}

.category-wrapper[data-manual-state="expanded"] .category-toggle,
.category-wrapper[data-manual-state="collapsed"] .category-toggle {
    background: rgba(24, 144, 255, 0.08);
}

.category-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #1890FF;
    border-radius: 0 2px 2px 0;
    transition: height 0.2s ease;
}

.category-item:hover {
    background: rgba(24, 144, 255, 0.08);
}

.category-item:hover::before {
    height: 20px;
}

.category-item.active {
    background: #E6F7FF;
    color: #1890FF;
}

.category-item.active::before {
    height: 24px;
}

.category-icon {
    font-size: 20px;
    color: #666666;
    margin-right: 12px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.category-item:hover .category-icon,
.category-item.active .category-icon {
    color: #1890FF;
    transform: scale(1.1);
}

.category-name {
    flex: 1;
    font-size: 14px;
    color: #4A4A4A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-item:hover .category-name,
.category-item.active .category-name {
    color: #1890FF;
    font-weight: 600;
}


/* 二级分类 - 现代化 */
.sub-categories {
    max-height: 500px;
    overflow-y: hidden;
    overflow-x: visible;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-category-item {
    padding: 10px 20px 10px 52px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 2px 12px;
    border-radius: 6px;
    font-size: 13px;
    position: relative;
    overflow: visible;
}

.sidebar.collapsed .sub-category-item {
    padding-left: 32px;
}

.sub-category-item:hover {
    background: rgba(24, 144, 255, 0.06);
    padding-left: 54px;
}

.sub-category-item.active {
    background: #E6F7FF;
    color: #1890FF;
}

.sub-category-item .category-icon {
    font-size: 16px;
    margin-right: 8px;
}

/* 快捷按钮区域 - 现代化 */
.sidebar-footer {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0 12px;
    background: #FFFFFF;
    overflow: visible;
}

/* 快速添加下拉菜单样式 */
.quick-add-toggle:hover {
    background: linear-gradient(135deg, #BBDEFB 0%, #E1BEE7 100%) !important;
    border-color: #90CAF9 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15) !important;
}

.quick-add-toggle:active {
    transform: translateY(0);
}

.quick-add-menu-item:hover {
    background: rgba(24, 144, 255, 0.08) !important;
}

.quick-add-menu {
    animation: slideDown 0.2s ease-out;
}

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

/* 移动端侧边栏底部区域确保可见 */
@media (max-width: 768px) {
    /* 移动端显示汉堡按钮 */
    .toggle-sidebar-btn {
        display: flex !important;
    }
    
    /* 移动端侧边栏底部固定 */
    .sidebar {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .sidebar-logo {
        flex-shrink: 0; /* LOGO不收缩 */
    }
    
    .sidebar-categories {
        flex: 1; /* 占据剩余空间 */
        overflow-y: auto !important; /* 允许滚动 */
        overflow-x: hidden;
        padding-bottom: 8px;
        /* 确保有足够的空间显示内容而不被底部按钮遮挡 */
        max-height: calc(100vh - 75px - 200px); /* 100vh - LOGO高度 - 底部按钮区域高度 */
    }
    
    .sidebar-footer {
        flex-shrink: 0; /* 底部不收缩 */
        padding: 12px;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); /* 适配刘海屏 */
        min-height: auto;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05); /* 添加顶部阴影，让底部区域更明显 */
        background: #FFFFFF;
        position: relative;
        z-index: 10; /* 确保在最上层 */
    }
    
    .sidebar-add-dropdown {
        margin-bottom: 8px;
    }
    
    .sidebar-footer-actions {
        padding: 0 !important;
    }
    
    /* 快速添加按钮在小屏幕上更明显 */
    .quick-add-toggle {
        font-size: 14px !important;
        box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15) !important;
    }
}

/* 超小屏幕优化 (320px-375px) */
@media (max-width: 375px) {
    .sidebar {
        width: 200px !important; /* 减小侧边栏宽度 */
    }
    
    .sidebar-categories {
        max-height: calc(100vh - 75px - 180px) !important; /* 更小的底部空间 */
    }
    
    .quick-add-toggle {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
    
    .quick-add-toggle .icon {
        font-size: 16px !important;
    }
    
    .sidebar-footer {
        padding: 8px !important;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
    }
    
    .sidebar-add-dropdown {
        padding: 6px 8px !important;
    }
    
    .footer-btn {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: #F8F9FA;
    color: #666666;
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: visible;
}

.footer-btn:hover {
    background: #E6F7FF;
    color: #1890FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15);
}

.footer-btn .icon {
    font-size: 16px;
    width: 16px !important;
    height: 16px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.footer-btn svg.icon {
    width: 16px !important;
    height: 16px !important;
}


/* 右侧内容区 */
.content-area {
    flex: 1;
    margin-left: 240px; /* 为固定的侧边栏留出空间 */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px); /* 减去顶栏高度 */
    overflow: hidden;
    background: #FFFFFF;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 顶栏 - 固定在页面顶部，覆盖整个宽度 */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px; /* 恢复合适的顶栏高度 */
    background: #FFFFFF;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    z-index: 1001; /* 确保在侧边栏和遮罩层之上 */
}

/* 汉堡按钮 - PC端默认隐藏 */
.toggle-sidebar-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-right: 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.toggle-sidebar-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.toggle-sidebar-btn:active {
    transform: scale(0.95);
}

.toggle-sidebar-btn .icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 暗色模式 - 汉堡按钮 */
body.dark-mode .toggle-sidebar-btn {
    color: #F0F6FC;
}

body.dark-mode .toggle-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* 滚动后的透明效果 */
.topbar.scrolled {
    background: rgba(255, 255, 255, 0.75) !important;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08) !important;
    border-bottom-color: rgba(0, 0, 0, 0.12) !important;
}

/* 悬浮的侧边栏折叠按钮 - 在内容区左侧 */
.floating-sidebar-toggle {
    position: fixed;
    left: 250px; /* 侧边栏宽度(240px) + 10px间距 */
    top: 50%; /* 垂直居中 */
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    border: none;
    background: rgba(248, 249, 250, 0.95);
    color: #666666;
    cursor: pointer;
    border-radius: 0 8px 8px 0; /* 右侧圆角 */
    font-size: 20px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                background 0.2s ease, 
                color 0.2s ease, 
                border-left-color 0.2s ease,
                box-shadow 0.2s ease;
    z-index: 999;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 3px solid transparent;
}

.floating-sidebar-toggle:hover {
    background: rgba(230, 247, 255, 0.95);
    color: #1890FF;
    border-left-color: #1890FF;
    left: 252px; /* 轻微右移 */
    box-shadow: 3px 0 12px rgba(24, 144, 255, 0.15);
}

.floating-sidebar-toggle .icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

/* 侧边栏折叠时，按钮移动到左侧边缘 */
.sidebar.collapsed ~ .content-area .floating-sidebar-toggle {
    left: 80px; /* 折叠后侧边栏宽度70px + 10px间距 */
}

.sidebar.collapsed ~ .content-area .floating-sidebar-toggle .icon {
    transform: rotate(180deg); /* 图标旋转，表示可以展开 */
}

/* 轮播图区域 */
.banner-container {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 20px; /* 进一步减少底部间距 */
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #F5F5F5;
}

/* 轮播图加载动画 */
.banner-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.banner-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(24, 144, 255, 0.1);
    border-top-color: #1890FF;
    border-radius: 50%;
    animation: bannerSpin 0.8s linear infinite;
}

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

.banner-loader-text {
    font-size: 14px;
    color: #8C8C8C;
    font-weight: 500;
}

.banner-container.loaded .banner-loader {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.banner-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.banner-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
    animation: kenBurns 12s ease-out forwards;
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.08);
    }
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.banner-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
    color: #FFFFFF;
    padding: 60px 48px 36px;
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.banner-caption h3 {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    animation: slideUp 0.8s ease-out 0.3s both;
}

.banner-caption p {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    opacity: 0.95;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    animation: slideUp 0.8s ease-out 0.5s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner-prev,
.banner-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
}

.banner-container:hover .banner-prev,
.banner-container:hover .banner-next {
    opacity: 1;
}

.banner-prev {
    left: 32px;
}

.banner-next {
    right: 32px;
}

.banner-prev:hover,
.banner-next:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%) scale(1.12);
}

.banner-prev:active,
.banner-next:active {
    transform: translateY(-50%) scale(0.98);
}

.banner-prev .icon,
.banner-next .icon {
    font-size: 24px;
    color: #FFFFFF;
    transition: color 0.3s;
}

.banner-prev:hover .icon,
.banner-next:hover .icon {
    color: #1890FF;
}

.banner-dots {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 3;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.banner-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.3);
}

.banner-dot.active {
    width: 32px;
    border-radius: 5px;
    background: #FFFFFF;
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.4);
}

.banner-dot.active::before {
    border-color: rgba(255, 255, 255, 0.3);
}

/* 暗色模式 - 轮播图 */
body.dark-mode .banner-container {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
    background: #161B22;
}

body.dark-mode .banner-loader-spinner {
    border-color: rgba(88, 166, 255, 0.2);
    border-top-color: #58A6FF;
}

body.dark-mode .banner-loader-text {
    color: #8B949E;
}

body.dark-mode .banner-prev,
body.dark-mode .banner-next {
    background: rgba(30, 30, 30, 0.9);
}

body.dark-mode .banner-prev:hover,
body.dark-mode .banner-next:hover {
    background: #1E1E1E;
}

body.dark-mode .banner-prev .icon,
body.dark-mode .banner-next .icon {
    color: #F0F6FC;
}

body.dark-mode .banner-caption {
    background: linear-gradient(to top, rgba(13, 17, 23, 0.9), transparent);
}

/* 响应式 - 轮播图 */
@media (max-width: 768px) {
    .banner-container {
        height: 240px;
        margin-bottom: 24px;
        border-radius: 16px;
    }
    
    .banner-caption {
        padding: 40px 24px 24px;
    }
    
    .banner-caption h3 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .banner-caption p {
        font-size: 14px;
    }
    
    .banner-prev,
    .banner-next {
        width: 44px;
        height: 44px;
        opacity: 1;
    }
    
    .banner-prev {
        left: 16px;
    }
    
    .banner-next {
        right: 16px;
    }
    
    .banner-prev .icon,
    .banner-next .icon {
        font-size: 20px;
    }
    
    .banner-dots {
        bottom: 20px;
        padding: 8px 16px;
        gap: 10px;
    }
    
    .banner-dot {
        width: 8px;
        height: 8px;
    }
    
    .banner-dot.active {
        width: 24px;
    }
}

/* 书签显示区域 - 统一左右边距 */
.bookmark-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px 24px 24px; /* 左右边距统一为24px */
    background: #FFFFFF;
}

.bookmark-area::-webkit-scrollbar {
    width: 6px;
}

.bookmark-area::-webkit-scrollbar-track {
    background: transparent;
}

.bookmark-area::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.bookmark-area::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* 分类卡片 - 现代化设计 */
.category-card {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: visible;
}

.category-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* 主分类名区域 */
.category-header {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #F0F2F5;
    margin-bottom: 16px;
    position: relative;
}

.category-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: #1890FF;
    border-radius: 2px 2px 0 0;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F1F1F;
    letter-spacing: 0.3px;
}

/* 分类刷新按钮 */
.refresh-category-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #F0F6FF;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1890FF;
    flex-shrink: 0;
    margin-left: 12px;
}

.refresh-category-btn:hover {
    background: #1890FF;
    color: #FFFFFF;
    transform: rotate(180deg);
}

.refresh-category-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.refresh-category-btn .icon {
    font-size: 16px;
}

/* 子分类标签区域 - 现代化 */
.sub-category-tags {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sub-tag {
    padding: 6px 18px;
    background: #F8F9FA;
    color: #666666;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-weight: 500;
}

.sub-tag:hover {
    background: #E6F7FF;
    color: #1890FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15);
}

.sub-tag.active {
    background: #1890FF;
    color: #FFFFFF;
    border-color: #1890FF;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

/* 书签卡片区域 */
.bookmark-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    overflow: visible;
}

/* 单个书签卡片 - 浅色系设计 */
.bookmark-card {
    width: 100%;
    height: 68px;
    background: #FFFFFF;
    border: 1px solid #E8E8E8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.bookmark-card.hidden {
    display: none;
}

.bookmark-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #E6F7FF;
    border-radius: 10px;
    transform: scale(0);
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

.bookmark-card:hover {
    background: #FFFFFF;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: #1890FF;
    overflow: visible;
    z-index: 100;
}

.bookmark-card:hover::before {
    transform: scale(1);
}

/* 加密书签样式 */
.bookmark-card.encrypted {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@supports not (backdrop-filter: blur(10px)) {
    .bookmark-card.encrypted {
        background: rgba(248, 249, 250, 0.5);
    }
}

.lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #999999;
    z-index: 1;
}

/* 书签图标区 */
.bookmark-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    margin-right: 10px;
    position: relative;
    z-index: 1;
}

.bookmark-icon img,
.bookmark-icon .icon {
    width: 24px !important;
    height: 24px !important;
    transition: transform 0.2s ease;
    display: inline-block !important;
}

.bookmark-icon svg.icon {
    width: 24px !important;
    height: 24px !important;
}

.bookmark-icon img {
    object-fit: contain;
}

.bookmark-icon img.default-icon {
    transform: rotate(-45deg);
}

.bookmark-card:hover .bookmark-icon img,
.bookmark-card:hover .bookmark-icon .icon {
    transform: scale(1.1);
}

.bookmark-card:hover .bookmark-icon img.default-icon {
    transform: rotate(-45deg) scale(1.1);
}

/* 书签备注浮窗 */
.bookmark-tooltip {
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: #F6FFED;
    color: #595959;
    padding: 14px 14px 10px 14px;
    border-radius: 8px;
    border: 1px solid #D9F7BE;
    font-size: 12px;
    line-height: 1.6;
    white-space: normal;
    max-width: 260px;
    word-wrap: break-word;
    word-break: break-word;
    box-shadow: 0 8px 30px rgba(217, 247, 190, 0.5), 0 0 0 1px rgba(217, 247, 190, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    pointer-events: none;
    font-weight: 400;
    text-align: center;
}

/* 添加箭头 - 指向书签（向上） */
.bookmark-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 12px 12px 12px;
    border-color: transparent transparent #F6FFED transparent;
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));
}

/* 悬停时显示 */
.bookmark-card:hover .bookmark-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
    top: calc(100% + 20px);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .bookmark-tooltip {
        max-width: 220px;
        font-size: 11px;
        padding: 12px 12px 8px 12px;
    }
    
    .bookmark-tooltip::after {
        border-width: 0 10px 10px 10px;
        margin-left: -10px;
    }
}

/* 书签信息区 */
.bookmark-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.bookmark-name {
    font-size: 15px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.bookmark-card:hover .bookmark-name {
    color: #1890FF;
}

.bookmark-desc {
    font-size: 12px;
    color: #999999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

/* 描述气泡提示 */
.bookmark-desc-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.85);
    color: #FFFFFF;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: normal;
    max-width: 300px;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bookmark-desc:hover .bookmark-desc-tooltip {
    display: block;
}

/* 书签功能区 */
.bookmark-actions {
    width: 40px;
    min-width: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    position: relative;
    height: 100%;
    z-index: 1;
}

/* 跳转图标始终垂直居中 */
.bookmark-actions .jump-icon {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* 离线标志样式和定位 - 一半在卡片内，一半在卡片外 */
.bookmark-actions .offline-badge {
    background: #F5222D;
    color: #FFFFFF;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    position: absolute !important;
    top: -29px !important;
    transform: none !important;
    z-index: 100 !important;
    border: 1px solid #E8E8E8;
    box-shadow: 0 0 0 0.5px #FFFFFF, 0 2px 8px rgba(245, 34, 45, 0.3);
}

.jump-icon {
    font-size: 22px;
    color: #BFBFBF;
    transition: all 0.2s ease;
}

.bookmark-card:hover .jump-icon {
    color: #8C8C8C;
    transform: scale(1.2) rotate(15deg);
}

/* 底部备案信息 */
.beian-footer {
    padding: 30px 20px 20px;
    text-align: center;
    font-size: 12px;
    color: #999999;
    border-top: 1px solid #F0F0F0;
    margin-top: 40px;
}

.beian-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.beian-item {
    display: inline-flex;
    align-items: center;
}

.beian-item a {
    color: #999999;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.beian-item a:hover {
    color: #1890FF;
}

.beian-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

/* 备案号复制提示 */
.beian-copy-tip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.beian-copy-tip.show {
    opacity: 1;
}

/* 密码输入弹窗 - 现代化 */
.password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.password-modal.show {
    display: flex;
}

.modal-content {
    background: #FFFFFF;
    padding: 32px;
    border-radius: 16px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #333333;
    text-align: center;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #FAFAFA;
}

.form-input:focus {
    outline: none;
    border-color: #1890FF;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.error-message {
    color: #F5222D;
    font-size: 12px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #FFF2F0;
    border-radius: 6px;
    border-left: 3px solid #F5222D;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    flex: 0 0 auto;
    padding: 7px 14px;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    min-width: auto;
    max-width: fit-content;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-primary {
    background: #1890FF;
    color: #FFFFFF;
    border-color: #1890FF;
}

.btn-primary:hover {
    background: #40A9FF;
    border-color: #40A9FF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 144, 255, 0.3);
}

.btn-primary .icon {
    color: #FFFFFF;
    fill: #FFFFFF;
}

.btn-secondary .icon {
    color: #595959;
    fill: #595959;
}

.btn-default {
    background: #FFFFFF;
    color: #666666;
}

.btn-default:hover {
    color: #1890FF;
    border-color: #1890FF;
    background: #E6F7FF;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999999;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    color: #666666;
}

/* 响应式适配 */
@media (max-width: 1200px) {
    .bookmark-cards {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .bookmark-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .bookmark-area {
        padding: 16px; /* 移动端保持16px padding */
    }
}

/* 加载动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* 顶栏Logo - PC端始终显示在最左侧 */
.topbar-logo {
    display: flex;
    align-items: center;
    margin-right: auto; /* 推到最左边，但折叠按钮会在其右侧 */
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
}

.topbar-logo.show {
    /* PC端无需此类，保留供兼容 */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* 顶栏logo图片 - 加大尺寸 */
.topbar-logo img {
    height: 60px; /* PC端LOGO加大 */
    width: auto;
    max-width: 280px;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* 顶栏logo文字 - 加大字号 */
.topbar-logo span {
    font-size: 28px; /* PC端文字加大 */
    font-weight: 700;
    color: #1F1F1F;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

/* 侧边栏收起状态 - 只显示图标 */
.sidebar.collapsed {
    width: 70px;
}

/* 侧边栏折叠时，内容区调整左边距 */
.main-container.sidebar-collapsed .content-area {
    margin-left: 70px;
}

/* PC端侧边栏LOGO已隐藏，这些规则仅用于移动端 */
.sidebar.collapsed .sidebar-logo h2,
.sidebar.collapsed .sidebar-logo span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-logo img {
    height: 45px;
    max-width: 45px;
}

.sidebar.collapsed .category-name,
.sidebar.collapsed .footer-btn span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    margin: 0;
}

.sidebar.collapsed .category-item,
.sidebar.collapsed .sub-category-item {
    padding: 12px 12px 12px 16px;
    justify-content: flex-start;
}

.sidebar.collapsed .category-icon {
    margin-right: 0;
    margin-left: 0;
}

.sidebar.collapsed .footer-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    align-items: center;
    display: flex;
}

.sidebar.collapsed .footer-btn .icon {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .sub-categories {
    display: none;
}

/* 侧边栏折叠时底部按钮竖列显示 */
.sidebar.collapsed .sidebar-footer {
    flex-direction: column;
    height: auto;
    gap: 8px;
    padding: 12px;
}

/* 侧边栏折叠时修改快速添加按钮样式 */
.sidebar.collapsed .sidebar-add-dropdown {
    padding: 0 !important;
    border-top: none !important;
    margin-bottom: 8px;
}

.sidebar.collapsed .quick-add-toggle {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    justify-content: center !important;
    position: relative;
}

.sidebar.collapsed .quick-add-toggle > div {
    margin: 0 !important;
}

.sidebar.collapsed .quick-add-toggle span,
.sidebar.collapsed .quick-add-toggle .dropdown-arrow {
    display: none !important;
}

.sidebar.collapsed .quick-add-toggle .icon {
    margin: 0 !important;
}

/* 折叠状态下隐藏下拉菜单 */
.sidebar.collapsed .quick-add-menu {
    display: none !important;
}

/* 折叠状态下的快速添加悬浮菜单 */
.quick-add-bubble {
    position: fixed;
    left: 82px;
    background: rgba(0, 0, 0, 0.9);
    color: #FFFFFF;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    min-width: 160px;
    pointer-events: none;
}

/* 向下显示（默认） */
.quick-add-bubble.show-below {
    transform-origin: top left;
}

.quick-add-bubble.show-below.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* 向上显示 */
.quick-add-bubble.show-above {
    transform-origin: bottom left;
    transform: translateY(10px);
}

.quick-add-bubble.show-above.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* 默认箭头（指向左侧，适用于向下显示） */
.quick-add-bubble::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 20px;
    border: 6px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
    transition: all 0.25s ease;
}

/* 向上显示时调整箭头位置 */
.quick-add-bubble.show-above::before {
    top: auto;
    bottom: 20px;
}

.quick-add-bubble .bubble-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    padding: 0 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.quick-add-bubble .bubble-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
    user-select: none;
}

.quick-add-bubble .bubble-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.quick-add-bubble .bubble-item:active {
    transform: scale(0.98);
}

.quick-add-bubble .bubble-item .icon {
    font-size: 16px;
    margin-right: 8px;
    color: #FFFFFF;
}

/* Flex布局会自动处理，不需要margin-left */

/* Tooltip提示气泡 - 仅在侧边栏折叠时显示 */
.sidebar.collapsed .category-item[data-tooltip]:not(.has-sub-categories),
.sidebar.collapsed .sub-category-item[data-tooltip],
.sidebar.collapsed .footer-btn[data-tooltip] {
    position: relative;
    --tooltip-top: 50%; /* 默认值 */
}

.sidebar.collapsed .category-item[data-tooltip]:not(.has-sub-categories)::after,
.sidebar.collapsed .sub-category-item[data-tooltip]::after,
.sidebar.collapsed .footer-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: fixed;
    left: 82px;
    top: var(--tooltip-top);
    transform: translateY(-50%);
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.85);
    color: #FFFFFF;
    font-size: 13px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed .category-item[data-tooltip]:not(.has-sub-categories)::before,
.sidebar.collapsed .sub-category-item[data-tooltip]::before,
.sidebar.collapsed .footer-btn[data-tooltip]::before {
    content: '';
    position: fixed;
    left: 76px;
    top: var(--tooltip-top);
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10000;
}

.sidebar.collapsed .category-item[data-tooltip]:not(.has-sub-categories):hover::after,
.sidebar.collapsed .sub-category-item[data-tooltip]:hover::after,
.sidebar.collapsed .category-item[data-tooltip]:not(.has-sub-categories):hover::before,
.sidebar.collapsed .sub-category-item[data-tooltip]:hover::before {
    opacity: 1 !important;
    visibility: visible !important;
    transition-delay: 0.2s; /* 鼠标悬停200ms后显示 */
}

/* 确保footer按钮的tooltip在折叠状态下也能显示 - 单独规则优先级更高 */
.sidebar.collapsed .footer-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip) !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10001 !important;
    transition-delay: 0s !important; /* 立即显示 */
    pointer-events: none !important;
}

.sidebar.collapsed .footer-btn[data-tooltip]:hover::before {
    content: '' !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10001 !important;
    transition-delay: 0s !important; /* 立即显示 */
    pointer-events: none !important;
}

/* Footer按钮hover效果增强 */
.sidebar.collapsed .footer-btn:hover {
    background: rgba(0, 122, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark-mode .sidebar.collapsed .footer-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 动态 Tooltip 样式（由 JavaScript 创建） */
.dynamic-tooltip {
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* 暗色模式下的动态 tooltip */
body.dark-mode .dynamic-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1F1F1F !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .dynamic-tooltip > div {
    border-right-color: rgba(255, 255, 255, 0.95) !important;
}

/* 有子分类时的气泡样式 */
.sub-categories-bubble {
    position: fixed;
    left: 82px;
    background: rgba(0, 0, 0, 0.9);
    color: #FFFFFF;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    min-width: 160px;
    max-width: 220px;
    pointer-events: none;
}

.sub-categories-bubble.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.sub-categories-bubble::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 20px;
    border: 6px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
}

.sub-categories-bubble .bubble-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    padding: 0 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.sub-categories-bubble .bubble-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
    user-select: none;
}

.sub-categories-bubble .bubble-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.sub-categories-bubble .bubble-item:active {
    transform: scale(0.98);
}

.sub-categories-bubble .bubble-item.clicked {
    background: rgba(24, 144, 255, 0.3) !important;
    transform: translateX(2px);
    transition: none; /* 立即显示高亮 */
}

.sub-categories-bubble .bubble-item .category-icon {
    font-size: 16px;
    margin-right: 8px;
    color: #FFFFFF;
}

.sub-categories-bubble .bubble-item .category-name {
    color: #FFFFFF;
    flex: 1;
}

/* 快捷按钮栏 - 不再使用 */
.quick-actions-bar {
    display: none;
}

.quick-action-btn {
    width: 48px;
    height: 48px;
    background: #FFFFFF;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.quick-action-btn:hover {
    background: #1890FF;
    border-color: #1890FF;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
    transform: scale(1.1);
}

.quick-action-btn::before {
    content: attr(title);
    position: absolute;
    right: calc(100% + 12px);
    background: #333333;
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.quick-action-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

.quick-action-btn .icon {
    font-size: 20px;
    color: #666666;
}

.quick-action-btn:hover .icon {
    color: #FFFFFF;
}

/* 暗色模式下的快捷按钮 */
body.dark-mode .quick-action-btn {
    background: #2A2A2A;
    border-color: #333333;
}

body.dark-mode .quick-action-btn:hover {
    background: #1890FF;
    border-color: #1890FF;
}

body.dark-mode .quick-action-btn::before {
    background: #1F1F1F;
    border: 1px solid #333333;
}

body.dark-mode .quick-action-btn .icon {
    color: #B8B8B8;
}

body.dark-mode .quick-action-btn:hover .icon {
    color: #FFFFFF;
}

/* 暗色模式 */
body.dark-mode {
    background: #0D1117;
    color: #C9D1D9;
}

body.dark-mode .sidebar {
    background: #161B22;
    border-right-color: #21262D;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .sidebar-logo {
    background: #0D1117;
    border-bottom-color: #21262D;
}

body.dark-mode .sidebar-logo h2 {
    color: #F0F6FC !important;
}

body.dark-mode .topbar-logo span {
    color: #F0F6FC !important;
}

body.dark-mode .topbar-logo img {
    filter: brightness(1.1); /* 暗色模式下图片稍微亮一些 */
}

body.dark-mode .category-item,
body.dark-mode .sub-category-item {
    color: #8B949E;
}

body.dark-mode .category-name {
    color: #8B949E;
}

body.dark-mode .category-item:hover,
body.dark-mode .category-item.active,
body.dark-mode .sub-category-item:hover {
    background: rgba(56, 139, 253, 0.1);
    color: #58A6FF;
}

body.dark-mode .category-item.active {
    background: rgba(56, 139, 253, 0.15);
}

body.dark-mode .category-icon {
    color: #8B949E;
}

body.dark-mode .category-item:hover .category-icon,
body.dark-mode .category-item.active .category-icon {
    color: #58A6FF;
}

body.dark-mode .category-toggle .icon {
    color: #666666;
}

body.dark-mode .category-toggle:hover {
    background: rgba(24, 144, 255, 0.15);
}

body.dark-mode .category-toggle:hover .icon {
    color: #1890FF;
}

/* 暗色模式下的锁定状态 */
body.dark-mode .category-wrapper[data-manual-state="expanded"] .category-toggle .icon,
body.dark-mode .category-wrapper[data-manual-state="collapsed"] .category-toggle .icon {
    color: #1890FF;
}

body.dark-mode .category-wrapper[data-manual-state="expanded"] .category-toggle,
body.dark-mode .category-wrapper[data-manual-state="collapsed"] .category-toggle {
    background: rgba(24, 144, 255, 0.12);
}

body.dark-mode .footer-btn {
    background: #21262D;
    color: #8B949E;
}

body.dark-mode .sidebar-footer {
    background: #0D1117 !important;
    border-top-color: #21262D;
}

/* 暗色模式下的移动端侧边栏底部 */
@media (max-width: 768px) {
    body.dark-mode .sidebar-footer {
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3) !important;
    }
}

/* 暗色模式下的快速添加下拉菜单 */
body.dark-mode .quick-add-toggle {
    background: linear-gradient(135deg, #1A3A52 0%, #2D2A47 100%) !important;
    border-color: #30363D !important;
    color: #58A6FF !important;
}

body.dark-mode .quick-add-toggle:hover {
    background: linear-gradient(135deg, #244561 0%, #3A3556 100%) !important;
    border-color: #388BFD !important;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.2) !important;
}

body.dark-mode .quick-add-menu {
    background: #161B22 !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5) !important;
    border-color: #30363D !important;
}

body.dark-mode .quick-add-menu-item {
    border-top-color: #21262D !important;
}

body.dark-mode .quick-add-menu-item span {
    color: #C9D1D9 !important;
}

body.dark-mode .quick-add-menu-item:hover {
    background: rgba(56, 139, 253, 0.15) !important;
}

/* 暗色模式下的Tooltip */
body.dark-mode .sidebar.collapsed .category-item[data-tooltip]::after,
body.dark-mode .sidebar.collapsed .sub-category-item[data-tooltip]::after,
body.dark-mode .sidebar.collapsed .footer-btn[data-tooltip]::after {
    background: rgba(255, 255, 255, 0.95);
    color: #1F1F1F;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .sidebar.collapsed .category-item[data-tooltip]::before,
body.dark-mode .sidebar.collapsed .sub-category-item[data-tooltip]::before,
body.dark-mode .sidebar.collapsed .footer-btn[data-tooltip]::before {
    border-right-color: rgba(255, 255, 255, 0.95);
}

/* 暗色模式下的子分类气泡 */
body.dark-mode .sub-categories-bubble {
    background: rgba(255, 255, 255, 0.95);
    color: #1F1F1F;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .sub-categories-bubble::before {
    border-right-color: rgba(255, 255, 255, 0.95);
}

body.dark-mode .sub-categories-bubble .bubble-title {
    color: rgba(31, 31, 31, 0.5);
    border-bottom: 1px solid rgba(31, 31, 31, 0.1);
}

body.dark-mode .sub-categories-bubble .bubble-item:hover {
    background: rgba(24, 144, 255, 0.15);
    transform: translateX(2px);
}

body.dark-mode .sub-categories-bubble .bubble-item.clicked {
    background: rgba(24, 144, 255, 0.25) !important;
    transform: translateX(2px);
    transition: none; /* 立即显示高亮 */
}

body.dark-mode .sub-categories-bubble .bubble-item .category-icon {
    color: #1F1F1F;
}

body.dark-mode .sub-categories-bubble .bubble-item .category-name {
    color: #1F1F1F;
}

/* 暗色模式 - 快速添加悬浮菜单 */
body.dark-mode .quick-add-bubble {
    background: rgba(255, 255, 255, 0.95);
    color: #1F1F1F;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .quick-add-bubble::before {
    border-right-color: rgba(255, 255, 255, 0.95);
}

body.dark-mode .quick-add-bubble .bubble-title {
    color: rgba(31, 31, 31, 0.5);
    border-bottom: 1px solid rgba(31, 31, 31, 0.1);
}

body.dark-mode .quick-add-bubble .bubble-item:hover {
    background: rgba(24, 144, 255, 0.15);
}

body.dark-mode .quick-add-bubble .bubble-item .icon {
    color: #1F1F1F;
}

/* 移动端隐藏快速添加悬浮菜单 */
@media (max-width: 768px) {
    .quick-add-bubble {
        display: none !important;
    }
}

body.dark-mode .footer-btn:hover {
    background: rgba(56, 139, 253, 0.15);
    color: #58A6FF;
}

body.dark-mode .topbar {
    background: rgba(13, 17, 23, 0.95);
    border-bottom-color: #21262D;
    backdrop-filter: blur(10px);
}

/* 暗色模式 - 滚动后的透明效果 */
body.dark-mode .topbar.scrolled {
    background: rgba(13, 17, 23, 0.7) !important;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4) !important;
    border-bottom-color: rgba(33, 38, 45, 0.6) !important;
}

/* 暗色模式 - 悬浮折叠按钮 */
body.dark-mode .floating-sidebar-toggle {
    background: rgba(33, 38, 45, 0.95);
    color: #8B949E;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .floating-sidebar-toggle:hover {
    background: rgba(56, 139, 253, 0.2);
    color: #58A6FF;
    border-left-color: #58A6FF;
    box-shadow: 3px 0 16px rgba(56, 139, 253, 0.3);
}

body.dark-mode .bookmark-area {
    background: #0D1117;
}

body.dark-mode .category-card {
    background: #161B22;
    border-color: #21262D;
}

body.dark-mode .category-title {
    color: #F0F6FC;
}

body.dark-mode .refresh-category-btn {
    background: #1C2128;
    color: #58A6FF;
}

body.dark-mode .refresh-category-btn:hover {
    background: #58A6FF;
    color: #0D1117;
}

body.dark-mode .sub-category-tags {
    border-top-color: #21262D;
}

body.dark-mode .sub-tag {
    background: #21262D;
    color: #8B949E;
}

body.dark-mode .sub-tag:hover {
    background: rgba(56, 139, 253, 0.15);
    color: #58A6FF;
}

body.dark-mode .sub-tag.active {
    background: #58A6FF;
    color: #FFFFFF;
}

body.dark-mode .bookmark-card {
    background: #161B22;
    border-color: #21262D;
}

body.dark-mode .bookmark-card::before {
    background: linear-gradient(90deg, #1890FF 0%, #13C2C2 100%);
}

body.dark-mode .bookmark-card:hover {
    background: #1C2128;
    border-color: #58A6FF;
    box-shadow: 0 4px 16px rgba(56, 139, 253, 0.2);
    z-index: 100;
}

/* 暗黑模式备注浮窗 */
body.dark-mode .bookmark-tooltip {
    background: #162312;
    color: #C9D1D9;
    box-shadow: 0 8px 30px rgba(135, 208, 104, 0.7), 0 0 0 1px rgba(135, 208, 104, 0.2);
    border: 1px solid rgba(135, 208, 104, 0.2);
}

body.dark-mode .bookmark-tooltip::after {
    border-color: transparent transparent #162312 transparent;
    filter: drop-shadow(0 -3px 8px rgba(0, 0, 0, 0.5));
}

body.dark-mode .bookmark-name {
    color: #C9D1D9;
}

body.dark-mode .bookmark-desc {
    color: #8B949E;
}

body.dark-mode .bookmark-icon {
    background: #0D1117;
    border-color: #30363D;
}

body.dark-mode .bookmark-url {
    color: #6E7681;
}

body.dark-mode .empty-state {
    color: #6E7681;
}

body.dark-mode .bookmark-actions .offline-badge {
    background: #DC2626;
    color: #FFFFFF;
    position: absolute !important;
    top: -29px !important;
    transform: none !important;
    z-index: 100 !important;
    border: 1px solid #21262D;
    box-shadow: 0 0 0 0.5px #161B22, 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* 密码模态框暗色模式 */
body.dark-mode .modal-content {
    background: #161B22;
    border-color: #21262D;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body.dark-mode .password-modal {
    background: rgba(1, 4, 9, 0.8);
}

body.dark-mode .modal-title {
    color: #F0F6FC;
}

body.dark-mode .form-label {
    color: #8B949E;
}

body.dark-mode .form-input {
    background: #0D1117;
    border-color: #21262D;
    color: #C9D1D9;
}

body.dark-mode .form-input:focus {
    border-color: #58A6FF;
    background: #0D1117;
}

body.dark-mode .error-message {
    color: #F85149;
}

body.dark-mode .btn-primary {
    background: #238636;
    color: #FFFFFF;
}

body.dark-mode .btn-primary:hover {
    background: #2EA043;
}

body.dark-mode .btn-primary .icon {
    color: #FFFFFF;
    fill: #FFFFFF;
}

body.dark-mode .btn-secondary .icon {
    color: #C9D1D9;
    fill: #C9D1D9;
}

body.dark-mode .btn-default {
    background: #21262D;
    color: #C9D1D9;
    border-color: #21262D;
}

body.dark-mode .btn-default:hover {
    background: #30363D;
    color: #F0F6FC;
    border-color: #8B949E;
}

/* 暗色模式 - 底部备案信息 */
body.dark-mode .beian-footer {
    border-top-color: #21262D;
}

body.dark-mode .beian-item a {
    color: #8B949E;
}

body.dark-mode .beian-item a:hover {
    color: #58A6FF;
}

body.dark-mode .beian-copy-tip {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363D;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
/* ========== 移动端响应式优化 ========== */

/* 遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* 关键：未激活时不拦截点击 */
    transition: all 0.3s ease;
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* 激活时可以点击 */
}

/* 平板设备 (768px - 1024px) - 使用 transform 方案 */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 240px !important;
        height: 100vh !important;
        z-index: 1000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .sidebar.mobile-active {
        transform: translateX(0) !important;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2) !important;
    }
    
    .content-area {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    /* 防止侧边栏打开时页面滚动 */
    body.sidebar-open {
        overflow: hidden !important;
    }
}

/* 移动端设备 (max-width: 768px) */
@media (max-width: 768px) {
    /* 移动端隐藏悬浮折叠按钮 */
    .floating-sidebar-toggle {
        display: none !important;
    }
    
    /* 移动端：顶栏固定在顶部 */
    .topbar {
        position: fixed;
        padding: 0 12px !important;
        height: 56px !important;
    }
    
    .main-container {
        margin-top: 56px;
        height: calc(100vh - 56px);
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
    }
    
    .content-area {
        margin-left: 0; /* 移动端内容区不需要左边距 */
        height: calc(100vh - 56px); /* 减去顶栏高度 */
    }
    
    /* 移动端显示侧边栏LOGO，隐藏顶栏LOGO */
    .sidebar-logo {
        display: flex !important;
    }
    
    .topbar-logo {
        display: none !important;
    }
    
    /* 汉堡按钮优化 - 增大触摸区域 */
    .toggle-sidebar-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent;
        border: none;
        cursor: pointer;
        color: inherit;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        position: relative;
    }
    
    /* 汉堡按钮点击反馈 */
    .toggle-sidebar-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.05);
        border-radius: 50%;
        transform: translate(-50%, -50%) scale(0);
        transition: transform 0.2s ease;
    }
    
    .toggle-sidebar-btn:active::before {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .toggle-sidebar-btn .icon {
        font-size: 24px !important;
        width: 24px !important;
        height: 24px !important;
        position: relative;
        z-index: 1;
    }
    
    /* 顶栏移动端优化 */
    .topbar {
        padding: 0 12px !important;
        height: 56px !important;
    }
    
    /* 书签卡片移动端优化 */
    .bookmark-card {
        min-height: 64px !important;
        padding: 10px 12px !important;
    }
    
    /* 分类标题移动端优化 */
    .category-title {
        font-size: 18px !important;
        padding: 12px 15px !important;
    }
    
    /* 轮播图移动端优化 */
    .banner-carousel {
        height: 200px !important;
        border-radius: 8px !important;
    }
}

/* 小屏幕手机 (max-width: 480px) */
@media (max-width: 480px) {
    .sidebar {
        width: 280px !important;
        transform: translateX(-100%) !important;
    }
    
    .sidebar.mobile-active {
        transform: translateX(0) !important;
    }
    
    /* 书签卡片单列布局 */
    .bookmarks-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    /* 轮播图高度调整 */
    .banner-carousel {
        height: 160px !important;
    }
    
    /* 顶栏Logo字号 */
    .topbar-logo {
        font-size: 16px !important;
    }
}

/* 横屏模式优化 */
@media (max-width: 896px) and (orientation: landscape) {
    .sidebar {
        width: 220px !important;
        transform: translateX(-100%) !important;
    }
    
    .sidebar.mobile-active {
        transform: translateX(0) !important;
    }
    
    .banner-carousel {
        height: 150px !important;
    }
    
    .topbar {
        height: 48px !important;
    }
}

/* 暗色模式 - 遮罩层 */
body.dark-mode .sidebar-overlay {
    background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .toggle-sidebar-btn:active::before {
    background: rgba(255, 255, 255, 0.1);
}
