/* QiMeng Theme Custom Styles */

/* ============================================
 * 核心变量（必须在最前面导入）
 * ============================================ */
@import url('core/variables.css');

/* ============================================
 * 模块样式
 * ============================================ */
@import url('modules/base.css');
@import url('modules/header.css');
@import url('modules/modals.css');
@import url('modules/components.css');
@import url('modules/cards.css');
@import url('modules/dark-mode.css');
@import url('modules/user-center.css');
@import url('modules/menu.css');
@import url('modules/minimal-style.css');
@import url('post-editor.css');


.qm-autosave-status::before {
    display: none !important;
}


#qm-home-layout {
    align-items: flex-start;
}

#qm-home-main {
    align-self: flex-start;
}

#qm-home-sidebar {
    align-self: flex-start;
}

/* 调小侧边栏宽度 */
@media (min-width: 992px) {
    #qm-home-sidebar.col-lg-3 {
        flex: 0 0 22% !important;
        max-width: 22% !important;
    }
    
    #qm-home-main.col-lg-9 {
        flex: 0 0 78% !important;
        max-width: 78% !important;
    }
    
    /* 调小侧边栏模块里的元素大小 */
    #qm-home-sidebar .qm-sidebar-user-header {
        height: 8rem;
    }
    
    #qm-home-sidebar .qm-sidebar-user-header-glass {
        padding: 0.5rem 0.7rem;
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }
    
    #qm-home-sidebar .qm-sidebar-user-avatar {
        width: 64px;
        height: 64px;
    }
    
    #qm-home-sidebar .qm-sidebar-user-header-glass h3,
    #qm-home-sidebar .qm-sidebar-user-header-glass .h6 {
        font-size: 0.875rem;
    }
    
    #qm-home-sidebar .qm-sidebar-user-header-glass .small {
        font-size: 0.75rem;
    }
    
    #qm-home-sidebar .qm-sidebar-stat-item {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
    
    #qm-home-sidebar .qm-sidebar-stat-item .fw-bold {
        font-size: 0.9375rem;
    }
    
    #qm-home-sidebar .qm-sidebar-stat-item .small {
        font-size: 0.6875rem;
    }
    
    #qm-home-sidebar .qm-sidebar-quick-icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
    
    #qm-home-sidebar .qm-sidebar-quick-item .small {
        font-size: 0.6875rem;
    }
    
    #qm-home-sidebar .qm-sidebar-user .p-3 {
        padding: 0.75rem !important;
    }
    
    #qm-home-sidebar .qm-sidebar-user .px-3 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    #qm-home-sidebar .qm-sidebar-user .pb-3 {
        padding-bottom: 0.75rem !important;
    }
    
    #qm-home-sidebar .qm-sidebar-card .card-body {
        padding: 0.875rem;
    }
    
    #qm-home-sidebar .qm-sidebar-card .px-4 {
        padding-left: 0.875rem !important;
        padding-right: 0.875rem !important;
    }
    
    #qm-home-sidebar .qm-sidebar-card .py-3 {
        padding-top: 0.875rem !important;
        padding-bottom: 0.875rem !important;
    }
    
    #qm-home-sidebar .qm-sidebar-card h3,
    #qm-home-sidebar .qm-sidebar-card .h6 {
        font-size: 0.9375rem;
    }
    
    #qm-home-sidebar .qm-sidebar-icon-hot,
    #qm-home-sidebar .qm-sidebar-icon-tag {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.8125rem;
    }
    
    #qm-home-sidebar .qm-sidebar-hot-thumb {
        width: 64px;
        height: 46px;
    }
    
    #qm-home-sidebar .qm-sidebar-rank-badge {
        font-size: 0.6875rem;
        height: 1.35rem;
        min-width: 2.05rem;
        padding: 0 0.6rem;
        border-radius: 0.55rem;
    }
    
    #qm-home-sidebar .qm-sidebar-hot-title {
        font-size: 0.8125rem;
    }
    
    #qm-home-sidebar .qm-sidebar-hot-meta {
        font-size: 0.6875rem;
    }
    
    #qm-home-sidebar .qm-sidebar-tag-pill {
        padding: 0.1875rem 0.5rem;
        font-size: 0.75rem;
    }
    
    #qm-home-sidebar .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 1024px下调整布局：保持卡片大小不变，增加侧边栏宽度 */
@media (min-width: 1024px) and (max-width: 1279.98px) {
    #qm-home-sidebar.col-lg-3 {
        flex: 0 0 30% !important;
        max-width: 30% !important;
    }
    
    #qm-home-main.col-lg-9 {
        flex: 0 0 70% !important;
        max-width: 70% !important;
    }
}

/* 1280px及以上恢复原布局，显示4列 */
@media (min-width: 1280px) {
    #qm-home-sidebar.col-lg-3 {
        flex: 0 0 22% !important;
        max-width: 22% !important;
    }
    
    #qm-home-main.col-lg-9 {
        flex: 0 0 78% !important;
        max-width: 78% !important;
    }
}


#qm-home-sidebar [data-qm-home-sidebar-inner] > *:first-child {
    margin-top: 0.75rem;
}

/* 确保卡片之间有适当的间距 */
#qm-home-sidebar [data-qm-home-sidebar-inner] > *:not(:first-child) {
    margin-top: 0.75rem;
}

@media (min-width: 992px) {
    #qm-home-sidebar [data-qm-home-sidebar-inner] > *:first-child {
        margin-top: 0.875rem;
    }
    
    #qm-home-sidebar [data-qm-home-sidebar-inner] > *:not(:first-child) {
        margin-top: 0.875rem;
    }
}


#qm-home-main > *:first-child {
    margin-top: 0;
}


@media (min-width: 1024px) {
    
    #qm-home-main .qm-module-header {
        margin-top: 0;
        padding-top: 0;
    }
    
    
    #qm-home-sidebar [data-qm-home-sidebar-inner] > *:first-child {
        margin-top: 0.875rem;
    }
    
    
    #qm-home-sidebar [data-qm-home-sidebar-inner] > .qm-task-widget:first-child {
        margin-top: 0.875rem;
    }
    
    
    
    #qm-home-sidebar [data-qm-home-sidebar-inner] > *:first-child > div:first-child {
        padding-top: 0;
    }
    
    
    #qm-home-sidebar [data-qm-home-sidebar-inner] > .qm-sidebar-author-card:first-child {
        margin-top: 0;
        padding-top: 0;
    }
    
    
    #qm-home-sidebar [data-qm-home-sidebar-inner] > *:first-child h3,
    #qm-home-sidebar [data-qm-home-sidebar-inner] > *:first-child .qm-sidebar-section-title {
        margin-top: 0;
    }
    
    
    #qm-home-sidebar [data-qm-home-sidebar-inner] > .qm-task-widget:first-child .qm-task-widget__header {
        padding-top: 0;
    }
}
