﻿.CntStyle {
    margin: 0;
    font-family: 微軟正黑體 !important, Arial, sans-serif;
    display: flex;
    min-height: 100vh;
}

/* 左欄 */
.LeftSide {
    overflow-y: auto; /* 若左側內容過多也能滾動 */
    width: 260px;
    background: #f7f7f8;
    color: #1a1a1a;
    padding: 20px;
    transition: transform 0.3s ease;
}

/* 中間內容 */
.MainSide {
    flex: 1;
    background: #fff;
    padding: 20px;
    padding-bottom: 30px;
    margin-left: 260px; /* 桌面版避開 sidebar 寬度 */
}

/* 右欄 */
.RightSide {
    width: 260px;
    background: #fff;
    padding: 20px;
}


/* 漢堡選單按鈕 */
.toggle-hr {
    display: none;
    position: fixed;
    top: 108px;
    left: 0px;
    background: #f7f7f8;
    color: #073763;
    border: none;
    padding: 10px 15px;
    font-size: 18px;
    cursor: pointer;
    z-index: 1100;
    text-decoration: none;
}

/* 手機模式 */
@media (max-width: 768px) {
    .CntStyle {
        flex-direction: row;
    }

    .LeftSide {
        overflow-y: auto; /* 若左側內容過多也能滾動 */
        position: fixed;
        top: 155px;
        left: 0;
        bottom: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 9999;
    }

        .LeftSide.open {
            transform: translateX(0);
        }

    .toggle-hr {
        display: block;
    }

    .MainSide {
        flex: 1;
        background: #fff;
        padding: 20px;
        padding-bottom: 30px;
        margin-left: 0; /* 手機版移除左邊距 */
        width: 100%; /* 確保完整寬度 */
    }
}

.new-chat-btn {
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    text-align: left;
    width: 100%;
    transition: all 0.2s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f0f0f0;
    color: #1a1a1a;
    text-decoration: none;
}

    .new-chat-btn:hover {
        background-color: #4A4B51;
        text-decoration: none;
    }

    .new-chat-btn:hover {
        background-color: #e5e5e5;
        text-decoration: none;
    }

    .new-chat-btn .icon {
        font-size: 0.85rem; /* 調整圖示大小與文字一致 */
        display: flex;
        align-items: center;
        text-decoration: none;
    }


/* 發送按鈕樣式 */
.send-btn {
    width: 38px; /* 與輸入框高度一致 */
    height: 38px; /* 與輸入框高度一致 */
    padding: 0;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
}

    .send-btn:hover {
        background-color: #45A049;
        transform: scale(1.05);
        text-decoration: none;
        color: #fff;
    }

    .send-btn .icon {
        font-size: 1.1rem;
        text-decoration: none;
    }

    .send-btn:visited {
        color: #fff;
    }


.group-title {
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #999;
}

.history-group {
    margin-bottom: 1.5rem;
}

.txt {
    max-width: 160px; /* 你要限制的寬度 */
    overflow: hidden; /* 超出部分隱藏 */
    text-overflow: ellipsis; /* 超出顯示 ... */
    vertical-align: middle; /* 可選，讓文字對齊更好看 */
}

.history-item {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s;
    white-space: nowrap;
    color: #1a1a1a;
}

    .history-item:hover {
        background-color: #3A3B41;
        color: #fff;
    }

.light-mode .history-item:hover {
    background-color: #e5e5e5;
    color: #1a1a1a;
}

.history-item .icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.align-items-center {
    align-items: center !important;
}

.d-flex {
    display: flex !important;
}

.flex-grow-1 {
    flex-grow: 1 !important;
}

/* 資料來源下拉選單樣式 */
.data-source-select {
    position: relative;
    top: auto;
    left: auto;
}

/* 下拉按鈕基本樣式 */
.dropdown-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: transparent;
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 資料來源按鈕寬度 */
.data-source-select:first-child .dropdown-btn {
    min-width: 120px;
}

/* 助理按鈕寬度 */
.data-source-select:last-child .dropdown-btn {
    min-width: 80px; /* 縮小助理按鈕的寬度 */
}

/* 下拉內容寬度保持不變 */
.dropdown-content {
    width: 300px;
}

.dropdown-btn i {
    font-size: 0.8rem;
    opacity: 0.6;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0 !important;
    background-color: #202123;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    padding: 0.5rem 0;
}

.dropdown-content {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.item-title {
    color: #1a1a1a;
}

.accordion .listBorder {
    border-left: 6px solid #DEEFE7;
}

.px-2 {
    padding-right: .5rem !important;
    padding-left: .5rem !important;
}

ms-2 {
    margin-left: .5rem !important;
}

.dropdown, .dropend, .dropstart, .dropup {
    position: relative;
}


.me-auto {
    margin-right: auto !important;
}

.sourceTitle {
    color: #13678A;
    font-weight: bold;
    font-size: large;
}

.sourceContext {
    color: #000;
    line-height: 22px;
    padding-top: 15px;
    font-size: 16px;
    font-weight: 600;
}

.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: .25rem;
}

.collapse .list-group-item, .list-group-item {
    background-color: #fff !important;
    color: #1a1a1a !important;
    border: 0px !important;
}

    .list-group-item:first-child {
        border-top-left-radius: inherit;
        border-top-right-radius: inherit;
    }

.align-items-start {
    align-items: flex-start !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.d-flex {
    display: flex !important;
}

.list-group-item {
    position: relative;
    display: block;
    padding: .5rem 1rem;
    color: #212529;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, .125);
}

.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 1rem;
    border-radius: .25rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}



/* 輸入區域容器樣式 */
.input-container {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    z-index: 1000; /* 確保比側邊欄低 */
    padding-bottom: 20px;
    background-color: #ffffff;
}


.img-container {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    text-align: center;
}


.image-mask {
    width: 150px;
    height: 150px;
    min-height: 150px;
    min-width: 150px;
    clip-path: inset(0);
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid #f1f1f1;
    transition: transform 0.3s ease;
}

.custom-image {
    border: 0px;
    width: 90%;
    height: auto;
    display: block;
    /* margin: 0 auto; */
    cursor: zoom-in;
    z-index: 1;
    margin-top: 10px;
    margin-bottom: 10px;
}


@media (min-width: 600px) {
    .img-container {
        grid-template-columns: 1fr 1fr;
    }
}

.img-container .custom-image:nth-child(1) {
    width: 90%;
    margin-left: 5px;
}

@media (min-width: 600px) {
    .custom-image:nth-child(1) {
        grid-column: span 2;
    }
}

/* 桌面版強制修正佈局 */
@media (min-width: 769px) {
    .CntStyle {
        display: flex !important;
        min-height: 100vh !important;
    }

    .LeftSide {
        width: 260px !important;
        position: sticky !important;
        top: 0 !important;
        height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        background: #f7f7f8 !important;
        color: #1a1a1a !important;
        padding: 20px !important;
        flex-shrink: 0 !important;
    }

    .MainSide {
        flex: 1 !important;
        background: #fff !important;
        padding: 20px !important;
        padding-bottom: 30px !important;
        margin-left: 0 !important; /* 移除左邊距，因為使用 flex */
    }
}

/* 自定義捲軸樣式 */
.LeftSide::-webkit-scrollbar {
    width: 6px;
}

.LeftSide::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.LeftSide::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

    .LeftSide::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* 閃爍動畫 */
.blinking-text {
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}


/* 發送按鈕樣式 */
.scrh-btn {
    width: 38px; /* 與輸入框高度一致 */
    height: 38px; /* 與輸入框高度一致 */
    padding: 0;
    background-color: #073763;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
}

    .scrh-btn:hover {
        background-color: #073763;
        transform: scale(1.05);
        text-decoration: none;
        color: #fff;
    }

    .scrh-btn .icon {
        font-size: 1.1rem;
        text-decoration: none;
    }

    .scrh-btn:visited {
        color: #fff;
    }

/* 發送按鈕樣式 */
.smit-btn {
    width: 38px; /* 與輸入框高度一致 */
    height: 38px; /* 與輸入框高度一致 */
    padding: 0;
    background-color: #073763;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
}

    .smit-btn:hover {
        background-color: #073763;
        transform: scale(1.05);
        text-decoration: none;
        color: #fff;
    }

    .smit-btn .icon {
        font-size: 1.1rem;
        text-decoration: none;
    }

    .smit-btn:visited, .smit-btn:active, .smit-btn:focus, .smit-btn:hover {
        color: white; /* 點擊中也保持白色 */
        outline: none;
        box-shadow: none; /* 有需要也可移除陰影 */
    }


/* 在所有螢幕尺寸下保持一致高度 */
@media (max-width: 576px) {
    .smit-btn {
        width: 38px;
        height: 38px;
    }

    .send-btn {
        width: 38px;
        height: 38px;
    }

    .scrh-btn {
        width: 38px;
        height: 38px;
    }
}
