/**
 * 网易大神风格侧边栏导航样式
 * 类似游戏社区的板块导航
 */

/* 基础变量 - 网易大神风格 */
:root {
    --sidebar-width: 200px; /* 恢复合适的侧边栏宽度 */
    --sidebar-bg: #ffffff;
    --sidebar-text: #333333;
    --sidebar-text-light: #666666;
    --sidebar-hover: #f5f5f5;
    --sidebar-active: #f5222d;
    --sidebar-active-bg: #fff2f0;
    --sidebar-border: #e8e8e8;
    --sidebar-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --sidebar-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --section-bg: #fefefe;
    --section-border: #fafafa;
    --header-height: 54px; /* 顶部导航高度，实际导航条高度54px */
}

/* 主容器 */
.moedes-sidebar-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    z-index: 999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 隐藏切换按钮 - 固定显示模式下不需要 */
.sidebar-nav-toggle {
    display: none !important;
}

/* 侧边栏内容容器 */
.sidebar-nav-content {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--sidebar-bg);
    transform: translateX(0);
    display: flex;
    flex-direction: column;
    box-shadow: var(--sidebar-shadow);
    z-index: 999;
    border-top: 1px solid var(--sidebar-border);
}

/* 移除关闭状态的样式 - 固定显示模式下不需要 */
.moedes-sidebar-nav.closed .sidebar-nav-content {
    transform: translateX(0);
}

/* 导航内容区域 - 无头部版本 */
.moedes-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    height: 100%;
}

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

.moedes-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 2px;
}

/* 导航区域分组 */
.sidebar-nav-section {
    margin-bottom: 8px;
}

/* 基础导航项（热门动态等） */
.nav-item-basic {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--sidebar-transition);
    margin: 0 6px;
    border-radius: 4px;
    position: relative;
}

.nav-item-basic:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    text-decoration: none;
}

.nav-item-basic.is-current {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    font-weight: 500;
}

.nav-item-basic .nav-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    width: 18px;
    height: 18px;
}

.nav-item-basic .nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-item-basic .nav-text {
    font-size: 13px;
    font-weight: 500;
}

/* Tab导航样式 */
.tab-navigation {
    margin: 8px 0;
}

.tab-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tab-nav-list li {
    margin: 2px 8px;
}

.tab-nav-list a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--sidebar-text-light);
    text-decoration: none;
    transition: var(--sidebar-transition);
    border-radius: 4px;
    font-size: 13px;
}

.tab-nav-list a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    text-decoration: none;
}

.tab-nav-list .tab-icon {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
}

.tab-nav-list .tab-icon svg {
    width: 100%;
    height: 100%;
}

/* 折叠分类样式 */
.collapsible-section {
    margin: 8px 0;
    border-radius: 6px;
    overflow: hidden;
}

.section-header {
    width: 100%;
    background: var(--section-bg);
    border: none;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--sidebar-transition);
    font-size: 13px;
    font-weight: 500;
    color: var(--sidebar-text);
    margin: 0 6px;
    border-radius: 4px;
}

.section-header:hover {
    background: var(--sidebar-hover);
}

.section-header.expanded {
    background: var(--sidebar-hover);
}

.section-icon {
    font-size: 11px;
    transition: var(--sidebar-transition);
    color: var(--sidebar-text-light);
    font-weight: 400;
    display: inline-block;
}

.section-header.expanded .section-icon {
    transform: rotate(180deg);
}

/* 分类内容区域 */
.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin: 0 8px;
}

.section-content.expanded {
    max-height: 500px;
}

.section-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--sidebar-bg);
    border-radius: 0 0 6px 6px;
}

.section-content li {
    border-bottom: 1px solid var(--section-border);
}

.section-content li:last-child {
    border-bottom: none;
}

.section-content a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: var(--sidebar-text-light);
    text-decoration: none;
    transition: var(--sidebar-transition);
    font-size: 13px;
}

/* 板块缩略图样式 */
.section-content .plate-thumbnail {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--sidebar-hover);
}

.section-content .plate-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-content a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    text-decoration: none;
}

.section-content .count {
    font-size: 12px;
    color: var(--sidebar-text-light);
    opacity: 0.7;
}

/* 底部区域 - 简化版本 */
.sidebar-nav-footer {
    padding: 15px;
    border-top: 1px solid var(--sidebar-border);
    color: var(--sidebar-text-light);
    font-size: 11px;
    text-align: center;
    background: var(--section-bg);
}

.sidebar-nav-footer p {
    margin: 0;
    line-height: 1.3;
}

/* 遮罩层 - 默认不显示 */
.sidebar-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--sidebar-transition);
    z-index: 9998;
}

/* 只有在明确打开状态时才显示遮罩层 */
.moedes-sidebar-nav.overlay-active .sidebar-nav-overlay {
    opacity: 1;
    visibility: visible;
}

/* 直角布局样式优化 */
.moedes-sidebar-nav {
    border-radius: 0;
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-nav-content {
    border-radius: 0;
    border-top: none; /* 与顶部导航无缝衔接 */
}

/* 响应式设计 - 移动端隐藏固定侧边栏 */
@media (max-width: 1024px) {
    /* 在平板和手机上隐藏侧边栏，恢复页面布局 */
    .moedes-sidebar-nav {
        display: none;
    }
}

@media (min-width: 1025px) {
    /* 确保在大屏幕上正确显示 */
    .moedes-sidebar-nav {
        display: block;
    }
}

/* 保持固定侧边栏宽度，不随屏幕尺寸变化，避免间距混乱 */

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
    :root {
        --sidebar-bg: #1a1a1a;
        --sidebar-text: #ffffff;
        --sidebar-hover: #2d2d2d;
        --sidebar-active: #0066cc;
        --sidebar-border: #333333;
    }
}

/* 高对比度适配 */
@media (prefers-contrast: high) {
    :root {
        --sidebar-bg: #000000;
        --sidebar-text: #ffffff;
        --sidebar-hover: #333333;
        --sidebar-active: #0099ff;
        --sidebar-border: #666666;
    }
}

/* 移除overflow限制 - 固定显示模式下不需要 */
body.sidebar-nav-open {
    overflow: auto;
}

/* 确保侧边栏在所有元素之上 */
.moedes-sidebar-nav * {
    box-sizing: border-box;
}

/* 修复可能的z-index冲突 */
.moedes-sidebar-nav {
    isolation: isolate;
}

/* Cache refresh 20250824_sidebar_solid_small_arrow_121200 */