:root {
    --primary-color: #4e54c8;
    --secondary-color: #8f94fb;
    --accent-color: #1a73e8;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f1 100%);
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(160deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px 0;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed) ease;
    z-index: 1000;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-left: 10px;
    font-weight: 600;
}

.sidebar-icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.menu-item {
    padding: 12px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid white;
}

.menu-item i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.submenu {
    list-style: none;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.submenu.show {
    max-height: 500px;
}

.submenu-item {
    padding: 10px 20px 10px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.submenu-item.active {
    color: #ffeb3b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-bar {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 60px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: #1a73e8;
}

.top-nav .nav-item {
    margin: 0 8px;
    padding: 8px 16px;
    text-decoration: none;
    color: #5f6368;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.top-nav .nav-item:hover {
    background-color: #f1f3f4;
}

.top-nav .nav-item.active {
    color: #1a73e8;
    background-color: #e8f0fe;
}

.main-layout {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    margin-top: 60px;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 280px;
    background: #fff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    z-index: 100;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar-toggle {
    background: transparent;
    color: #3c4043;
    border: none;
    padding: 8px;
    margin-right: 12px;
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s ease;
}

.sidebar-toggle:hover {
    color: #1a73e8;
}

.sidebar-toggle.collapsed {
    transform: rotate(180deg);
}

.sidebar h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #3c4043;
    padding-left: 12px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar summary,
.sidebar li>a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: #3c4043;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar summary:hover,
.sidebar li>a:hover {
    background-color: #e8e8e8;
}

.sidebar li>a.active,
.sidebar details li a.active {
    background-color: #1a73e8;
    color: #ffffff;
}

.sidebar details[open]>summary {
    background-color: #e8f0fe;
    color: #1967d2;
}

.sidebar details ul {
    margin-left: 20px;
    padding-top: 8px;
}

.sidebar details li a {
    font-weight: 400;
    color: #5f6368;
}

.sidebar summary {
    list-style: none;
}

.sidebar summary::-webkit-details-marker {
    display: none;
}

.sidebar summary::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 10px;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #3c4043;
    transition: transform 0.2s ease-in-out;
}

.sidebar details[open]>summary::before {
    transform: rotate(90deg);
}

.content-area {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.content-area.expanded {
    margin-left: 0;
}

#content-frame {
    width: 100%;
    height: 100%;
    border: none;
}