* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h3 {
    white-space: nowrap;
    overflow: hidden;
    font-size: 18px;
}

.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.toggle-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    border-bottom: 1px solid #34495e;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu a:hover {
    background: #34495e;
}

.nav-icon {
    margin-right: 10px;
    font-size: 16px;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
    display: block;
    text-align: center;
}

.sidebar.collapsed .nav-text {
    display: none;
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ecf0f1;
    height: 100vh;
}

.content-header {
    background: white;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: 70px;
}

.content-header h1 {
    color: #2c3e50;
    font-size: 24px;
}

.content-body {
    flex: 1;
    padding: 0;
    margin: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

/* iframe 样式 */
.content-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.iframe-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #7f8c8d;
    font-size: 16px;
    z-index: 10;
    text-align: center;
}

.error-message {
    padding: 40px;
    text-align: center;
    color: #e74c3c;
    background: #fdf2f2;
    border-radius: 8px;
    margin: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        z-index: 1000;
        height: 100vh;
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .content-body {
        margin: 10px;
    }
}
/* 分类标题样式 */
.nav-category {
    border-bottom: 1px solid #34495e;
}

.category-btn {
    width: 100%;
    background: #34495e;
    color: #ecf0f1;
    border: none;
    padding: 12px 20px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.3s;
}

.category-btn:hover {
    background: #3d566e;
}

.category-icon {
    margin-right: 10px;
    font-size: 14px;
}

.category-text {
    flex: 1;
    font-weight: bold;
    font-size: 14px;
}

.arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #233242;
    transition: all 0.3s ease;
}

.sub-menu.collapsed {
    display: none;
}

.sub-menu li {
    border-bottom: 1px solid #2c3e50;
}

.sub-menu li:last-child {
    border-bottom: none;
}

.sub-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 35px; /* 增加左边距显示层级 */
    color: #bdc3c7;
    text-decoration: none;
    transition: background 0.3s;
    font-size: 13px;
}

.sub-menu a:hover {
    background: #2c3e50;
    color: #ecf0f1;
}

/* 折叠状态下的样式 */
.sidebar.collapsed .category-text,
.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .category-btn {
    padding: 15px;
    justify-content: center;
}

.sidebar.collapsed .category-icon {
    margin-right: 0;
}

.sidebar.collapsed .sub-menu a {
    padding: 15px;
    justify-content: center;
}

.sidebar.collapsed .sub-menu a .nav-icon {
    margin-right: 0;
}

/* 确保折叠状态下子菜单也能正确隐藏 */
.sidebar.collapsed .sub-menu {
    position: absolute;
    left: 60px;
    top: 0;
    background: #2c3e50;
    min-width: 200px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    display: none;
}

.sidebar.collapsed .nav-category:hover .sub-menu {
    display: block;
}