﻿
* {
    box-sizing: border-box;
}

body {
    
    font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    height: 100vh;
    
}
/* 整体布局 flex, 占满视口 */
.app-wrapper {
    display: flex; 
    width: 100%; 
}

.menu1{ font-weight:bold }

/* ----- 左侧导航 (可折叠) ----- */
.sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, margin 0.25s ease;
    flex-shrink: 0;
    overflow-y: auto;
    height: 100vh;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 12px rgba(0,0,0,0.02);
}
    /* 手机端默认隐藏 (通过类控制) */
    .sidebar.collapsed {
        transform: translateX(-100%);
        margin-left: -280px; /* 配合宽度 */
    }
/* 侧边栏内部 */
.sidebar-header {
    padding: 5px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #FF0000;
}

    .sidebar-header .brand {
        font-weight: 650;
        font-size: 1.35rem;
        letter-spacing: -0.3px;
        display: flex;
        align-items: center;
        gap: 8px;
        color: #FFFFFF;
    }

        .sidebar-header .brand i {
            color: #4d6bfe;
            font-size: 1.5rem;
        }

.sidebar-close-mobile {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #555;
    cursor: pointer;
}

/* 历史对话列表 (模拟) */
.history-list {
    flex: 1;
    padding: 8px 12px 20px;
    overflow-y: auto;
}

.history-item {
    padding: 10px 14px;
    border-radius: 0px;
    margin-bottom: 4px;
    color: #1e1e1e;
    font-size: 0.95rem; 
    align-items: center;
    gap: 10px;
    cursor: default;
    transition: background 0.1s;
}

    .history-item a {
    display:block;
    text-decoration:none;
    }

        .history-item a.subtitle {
           font-size:13px;
           padding-left:10px;
           line-height:28px;
        }

    .history-item i {
        width: 20px;
       color: #6c6f78;
        font-size: 0.9rem;
    }

    .history-item:hover {
       /* background: #f1f3f5;*/
    }

    .history-item.active {
       background: #e9ecf3;
        font-weight: 500;
    }

.history-divider {
   
    color: #000000;
    padding: 16px 12px 6px 0px;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #4d6bfe;
    margin-bottom: 6px;
    font-weight: bold;
    
}

    .history-divider span {
        background-color: #4d6bfe;
        color:#FFFFFF;
        display:inline-block;
        padding:3px 5px;
    }
    /* ----- 右侧主内容 (聊天区域) ----- */
    .main-chat {
        flex: 1;
        display: flex;
        flex-direction: column;
        height: 100vh;
        background: #ffffff;
        min-width: 0;
        position: relative;
        overflow-y: scroll;
    }

/* 顶栏 - 包含菜单按钮 和 标题 */
.chat-topbar {
   /* padding: 12px 20px;*/
    border-bottom: 1px solid #efefef; 
    
    background: #F1F1F1;
}

.hamburger-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    padding: 0 6px;
    color: #2b2d33;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 30px;
    transition: background 0.1s;
}

    .hamburger-btn:hover {
        background: #eaeef3;
    }
 

.topbar-spacer {
    flex: 1;
}

.topbar-actions i {
    font-size: 1.2rem;
    color: #4a4e57;
    margin-left: 12px;
    opacity: 0.7;
    cursor: default;
}



/* 手机遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 9;
    opacity: 0;
    transition: opacity 0.2s;
}

    .sidebar-overlay.show {
        opacity: 1;
    }

/* 动画 */
@keyframes fadeIn {
    0% {
        opacity: 0.5;
        transform: translateY(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        margin-left: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,0.08);
        border-right: none;
        transition: transform 0.25s ease;
    }

        .sidebar.mobile-open {
            transform: translateX(0);
        }
        /* 覆盖全局的 collapsed 类, 手机不受影响 */
        .sidebar.collapsed {
            transform: translateX(-100%);
            margin-left: 0;
        }

        .sidebar.mobile-open.collapsed {
            transform: translateX(0);
            margin-left: 0;
        }

    .sidebar-close-mobile {
        display: block;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .chat-topbar .page-title {
        font-size: 0.95rem;
    }

    .message-item {
        max-width: 92%;
    }
}

/* 桌面: 默认侧边栏展开, 但是提供折叠类 */
@media (min-width: 769px) {
    .sidebar.collapsed {
        transform: translateX(-100%);
        margin-left: -280px;
        /* 占位隐藏 */
    }

    .sidebar-overlay {
        display: none !important;
    }
}
 
