/* ========== 左侧导航栏 · 精致编辑风 ========== */
.sidebar {
    width: 256px;
    background: var(--cream-soft);
    border-right: 1px solid var(--line);
    position: fixed;
    height: 100vh;
    overflow: visible;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

/* 导航内容滚动区域 */
.sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.sidebar-nav-scroll::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: #D3C8AC;
    border-radius: 4px;
}

/* 品牌区域 */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 18px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: 9px;
    box-shadow: 0 3px 8px -2px rgba(158, 66, 25, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    color: #FDF8F0;
    flex-shrink: 0;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 1px;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--ink-muted);
    letter-spacing: 3px;
    margin-top: 3px;
}

/* 分组标题 */
.nav-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px 7px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink-muted);
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.nav-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.nav-menu {
    list-style: none;
    padding: 0 12px;
}

.nav-item {
    position: relative;
    padding: 9px 12px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    color: var(--ink-soft);
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.nav-item:hover {
    background: #F1EAD9;
    color: var(--ink);
}

.nav-item.active {
    background: var(--orange-tint);
    color: var(--orange-ink);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: var(--orange);
}

.nav-item.active .nav-icon {
    color: var(--orange);
}

/* 外部链接标记 */
.nav-item.external::after {
    content: '↗';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    opacity: 0.4;
}

.nav-icon {
    margin-right: 10px;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    flex-shrink: 0;
    transition: color 0.18s ease;
}

.nav-icon svg {
    width: 16.5px;
    height: 16.5px;
}

.nav-item:hover .nav-icon {
    color: var(--ink-soft);
}

/* 侧边栏底部 */
.sidebar-footer {
    margin-top: auto;
    padding: 14px 20px 16px;
    border-top: 1px solid var(--line-soft);
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--ink-muted);
    text-align: center;
    letter-spacing: 2px;
}

.sidebar-footer-icp {
    display: block;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    text-decoration: none;
}

.sidebar-footer-icp:hover {
    color: var(--orange);
}

/* 用户信息容器 */
.user-info-wrapper {
    position: relative;
}

/* 用户悬浮菜单 */
.user-popup {
    position: absolute;
    left: calc(100% + 4px);
    top: auto;
    bottom: 0;
    transform: none;
    background: #FDFAF4;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 4px 0;
    min-width: 200px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease 0.25s, visibility 0.2s ease 0.25s;
}

.user-popup::before {
    content: '';
    position: absolute;
    left: -6px;
    top: auto;
    bottom: 18px;
    transform: rotate(45deg);
    width: 10px;
    height: 10px;
    background: #FDFAF4;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.user-info-wrapper:hover .user-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

/* 菜单项 */
.user-popup-item {
    padding: 8px 20px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-soft);
    transition: all 0.15s ease;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.user-popup-item:hover {
    background: #F1EAD9;
    color: var(--ink);
}

.user-popup-item:first-child {
    color: #C0392B;
    font-weight: 600;
}

.user-popup-item:first-child:hover {
    background: #FDECEA;
}

/* 分隔线 */
.user-popup-item + .user-popup-item {
    border-top: 1px solid var(--line-soft);
    margin-top: 0;
}

/* ========== 响应式 ========== */
@media (max-width: 920px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-item {
        margin-bottom: 0;
    }

    .nav-item.active::before {
        display: none;
    }
}
