/*
 * Theme Name: WebStack
 * Theme URI: https://www.iotheme.cn/
 * Description: 核心导航和布局样式 - 重新整理版本
 */

/* ===== 导航特定样式 ===== */
/* 基础样式已移至base.css和bootstrap-override.css */

/* ===== 页面容器布局 ===== */
.page-container {
    display: flex;
    width: 100%;
    min-height: auto; /* 改为auto，避免强制100vh高度 */
    position: relative;
    height: auto; /* 添加height: auto，确保高度自适应 */
}

/* ===== 侧边栏样式 ===== */
.sidebar-menu {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid #e4ecf3;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: width 0.3s ease;
    height: 100vh; /* 侧边栏保持100vh高度 */
}

.sidebar-menu.collapsed {
    width: 80px;
}

.sidebar-menu-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Logo区域 */
.sidebar-menu .logo-env {
    padding: 25px 20px;
    background: linear-gradient(180deg, #EFC3CA 0%, #f5f2f8 100%);
    flex-shrink: 0;
}

.sidebar-menu .logo-env .logo {
    text-align: center;
    width: 100%;
}

.sidebar-menu .logo-env .logo .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.sidebar-menu .logo-env .logo .logo-image {
    flex-shrink: 0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    height: 48px;
    width: auto;
}

.sidebar-menu .logo-env .logo .logo-text {
    font-size: 24px;
    font-weight: 800;
    color: #333;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sidebar-menu .logo-env .logo .logo-image-small {
    display: none;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 折叠状态下的logo样式 */
.sidebar-menu.collapsed .logo-env .logo .logo-container {
    display: none;
}

.sidebar-menu.collapsed .logo-env .logo .logo-image-small {
    display: block;
    margin: 0 auto;
    height: 40px;
    width: auto;
}

.sidebar-menu.collapsed .logo-env {
    padding: 19px 0;
}

/* 主菜单 */
    .sidebar-menu .main-menu {
    padding: 0;
    margin: 0;
    list-style: none;
    background: #f5f2f8;
    flex: 1;
    overflow-y: auto;
}


.sidebar-menu .main-menu a {
    color: #333333;
    text-decoration: none;
    display: block;
    padding: 13px 30px;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu .main-menu a > i {
    display: inline-block;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu .main-menu a > span {
    display: inline-block;
}

.sidebar-menu .main-menu a:hover {
    color: #a27dff;
    background-color: #f8f9fa;
}

.sidebar-menu .main-menu li.active > a {
    color: #a27dff;
    background-color: #f0f0ff;
}

/* 子菜单样式 */
.sidebar-menu .main-menu ul {
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #f0f0f0;
}

.sidebar-menu .main-menu li.has-sub > a:before {
    content: '\f107';
    font-family: FontAwesome;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    color: #6d747a;
    transition: transform 0.3s ease;
}

.sidebar-menu .main-menu li.has-sub.opened > a:before,
.sidebar-menu .main-menu li.has-sub.expanded > a:before {
    transform: translateY(-50%) rotate(0);
}

.sidebar-menu .main-menu ul li a {
    padding-left: 68px;
    font-size: 15px;
}

.sidebar-menu .main-menu ul li ul li a {
    padding-left: 85px;
}

/* 折叠状态下的菜单样式 */
.sidebar-menu.collapsed .main-menu > li > a > i {
    margin-right: 0;
    font-size: 20px;
    width: 100%;
    text-align: center;
}

.sidebar-menu.collapsed .main-menu > li > a > span {
        display: none;
    }

.sidebar-menu.collapsed .main-menu > li > a {
    padding: 13px 0;
        text-align: center;
}

.sidebar-menu.collapsed .main-menu > li.has-sub > a:before {
    display: none;
}

/* 提交网站按钮 */
.submit-tag {
    margin-top: 50px;
    padding: 0 30px 20px;
}

.submit-tag a {
    background: #a27dff;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
        display: block;
    text-align: center;
    transition: background-color 0.3s ease;
}

.submit-tag a:hover {
    background: #8b6fd8;
    color: white;
}

/* ===== 主内容区域 ===== */
.main-content {
    flex: 0 1 auto; /* 改为flex: 0 1 auto，避免过度拉伸 */
    margin-left: 250px;
    background: #f5f2f8;
    min-height: auto; /* 改为auto，避免强制100vh高度 */
    height: auto; /* 添加height: auto，确保高度自适应 */
    transition: margin-left 0.3s ease;
}

.sidebar-menu.collapsed + .main-content {
    margin-left: 80px;
}

/* 主内容区域内的内容样式 */
.main-content .sites-list {
    margin: 0;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.main-content .category-header-with-link,
.main-content .category-tabs-container {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

/* 确保内容区域内的元素对齐 */
.main-content > * {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* ===== 移动端响应式设计 ===== */
@media (max-width: 767px) {
    .page-container {
        flex-direction: column;
    }
    
    .sidebar-menu {
        position: fixed;
        width: 100%;
        height: auto;
        top: 0;
        z-index: 999;
        border-right: none;
        border-bottom: 1px solid #e4ecf3;
    }
    
    .sidebar-menu .logo-env {
        padding: 10px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .sidebar-menu .logo-env .logo .logo-text {
        font-size: 20px;
        max-width: 150px;
    }
    
    .sidebar-menu .main-menu {
        display: none;
        background: #fff;
        border-top: 1px solid #e4ecf3;
    }
    
    .sidebar-menu .main-menu.mobile-is-visible {
        display: block;
    }
    
    .sidebar-menu .main-menu li {
        border-bottom: 1px solid #e4ecf3;
    }
    
    .sidebar-menu .main-menu a {
            padding: 15px 20px;
        border-bottom: none;
    }
    
    .sidebar-menu .main-menu ul {
        background: #f8f9fa;
    }
    
    .sidebar-menu .main-menu ul li a {
        padding-left: 40px;
    }
    
    .sidebar-menu .main-menu ul li ul li a {
        padding-left: 60px;
    }

    .main-content {
        margin-left: 0;
        margin-top: 80px;
        padding: 0 15px;
    }
    
    .sidebar-menu.collapsed + .main-content {
        margin-left: 0;
    }
    
    .submit-tag {
        margin-top: 20px;
        padding: 0 20px 20px;
    }
}

/* ===== 移动端菜单切换按钮 ===== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: #a27dff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(162, 125, 255, 0.3);
}

@media (max-width: 767px) {
    .mobile-menu-toggle {
    display: flex;
    align-items: center;
        justify-content: center;
    }
}

/* ===== 工具提示和卡片样式 ===== */
/* 网站卡片样式已移至 homepage-grid.css 中统一管理 */

/* ===== 其他组件样式 ===== */
.nothing {
    padding: 20px 0;
    margin: 10px 0;
    text-align: center;
    color: #888;
    background: rgba(136, 136, 136, 0.2);
    border-radius: 5px;
}

/* ===== 工具类 ===== */
.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}

.clearfix:after {
    clear: both;
}

.d-flex {
    display: flex;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* ===== 打印样式 ===== */
@media print {
    .sidebar-menu {
        display: none;
    }
    
    .main-content {
    margin-left: 0;
        padding: 0;
    }
}