
/* reset & 基础变量 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    height: 100vh;
    overflow: hidden;
}

.copyright{
    display: flex;
    flex-direction: column;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

/* 布局容器：桌面默认flex，移动覆盖成块 */
.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    flex-direction: column;
}

/* ===== 侧边栏 (桌面左侧) ===== */
.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 12px rgba(0,0,0,0.02);
    transition: transform 0.3s ease-in-out, width 0.2s;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    z-index: 20;
}

/* 侧边栏头部 */
.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
}
.brand {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    cursor: pointer;
    flex-direction: column;
}
.brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}
.version {
    font-size: 0.8rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.2rem 0.7rem;
    border-radius: 30px;
    font-weight: 500;
    white-space: nowrap;
}

/* 导航菜单 */
.nav {
    flex: 1;
    position: relative;
}
.nav-content{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    overflow: auto;
    padding: 1.5rem 0rem;
}
.nav-section {
    margin-bottom: 2rem;
}
.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #64748b;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.7rem 1rem;
    margin: 0.1rem 0;
    border: none;
    background: none;
    border-radius: 40px;
    color: #334155;
    font-weight: 500;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.nav-item i {
    font-style: normal;
    width: 24px;
    color: #64748b;
    font-size: 1.2rem;
}
.nav-item:hover {
    background: #f1f5f9;
    color: #1e40af;
}
.nav-item.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}
.nav-item.active i {
    color: #2563eb;
}

/* ===== 右侧主要内容区域 ===== */
.content {
    flex: 1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* 移动端顶部导航栏 (默认隐藏) */
.mobile-navbar {
    display: none;
    background: #ffffff;
    padding: 0.8rem 1.2rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    flex-shrink: 0;
}
.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
}
.menu-toggle {
    background: none;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    line-height: 1;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.2s;
}
.menu-toggle:hover {
    background: #f1f5f9;
}

/* iframe 文档区 */
iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: white;
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 12px 30px -10px rgba(0,0,0,0.1);
    height: 100%;
}

/* ===== 响应式: 手机端改造 (max-width: 768px) ===== */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;  /* 切换为上下结构 */
    }

    /* 侧边栏变为浮层菜单，默认隐藏在屏幕左侧外 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px; /* 移动端菜单宽度 */
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 20px rgba(0,0,0,0.15);
        border-right: none;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* 显示移动顶部栏 */
    .mobile-navbar {
        display: flex;
    }

    /* 内容区占满剩余高度 */
    .content {
        height: calc(100% - 62px); /* 减去移动导航高度 */
        width: 100%;
    }

    iframe {
        border-radius: 0;
        height: 100%;
    }

    /* 点击菜单项后自动关闭浮层 */
    .nav-item {
        white-space: normal;
        word-break: break-word;
    }
}

/* 超小屏优化 */
@media (max-width: 480px) {
    .sidebar {
        width: 85%;
        max-width: 300px;
    }
    .mobile-brand {
        font-size: 1.2rem;
    }
}

/* 遮罩层(移动端菜单打开时) */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s;
}
.menu-overlay.show {
    display: block;
    opacity: 1;
}