@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* 在 wwwroot/css/site.css 或组件样式部分 */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* 禁用全局滚动条 */
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.page-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* 视口高度 */
    width: 100vw; /* 视口宽度 */
    max-height: 100vh;
    max-width: 100vw;
    overflow: hidden; /* 禁用容器滚动 */
}

.content {
    flex: 1;
    overflow: hidden; /* 禁用内容区域滚动 */
    display: flex;
    flex-direction: column;
}

/** footer  */
footer.layout-footer.is-fixed {
    height: 27px !important;
}
/** bootstrap 表格底部分页展示信息 样式覆盖*/

.pagination-bar .dropdown-toggle .form-select-append {
    width: 3px;
}

.pagination-bar .dropdown-toggle .form-select {
    padding: 0;
    margin: 0;
    width: 78px;
}

.pagination-bar {
    font-size: 8px;
}

.pagination-items .select {
    width: 68px;
}

.pagination-bar .pagination-items {
    width: 88px;
}

/** 表格滚动 */
.select .dropdown-menu {
    width: auto !important;
}

.layout-right {
    height: 100vh;
}

.layout-side {
    color: #3f4254;
    background-color: #e9ecef;
    box-shadow: 0 0 28px 0 rgb(82 63 105 / 5%);
}

.table-container {
    --bb-table-header-icon-active-color: #409eff;
}

    .table-container .overflow-auto {
        height: calc(100vh - 215px);
    }

        .table-container .overflow-auto thead {
            position: sticky;
            top: 0;
            width: 100%;
            /*z-index: 1000;*/
        }

            .table-container .overflow-auto thead th {
                background: #fff;
            }

.fontsize12 {
    font-size: 12px !important;
    font-size: 12px !important;
}

[role=button], [type=button], [type=reset], [type=submit], button {
    color: var(--bs-btn-color) !important;
}

/*表头高*/
.text-wrap {
    max-height: 40px;
}

/*.table-row.active {
    --bs-table-bg-type: #badafa;
}*/
.table tbody tr.active:not(.is-edit), .table-row.active {
    --bs-table-bg-type: #badafa;
}

/* 确保 Cascader 下拉选框的父容器使用相对定位 */
.cascader-container {
    position: relative;
}

/* 确保 Cascader 下拉选框使用绝对定位 */
.cascader-dropdown {
    z-index: 1000 !important; /* 根据需要调整 z-index 值 */
}

.month-day {
    padding: var(--bb-calendar-cell-padding);
    height: 105px;
}

/* dscha */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

/* 消息列表容器 - 修复滚动问题 */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    z-index: 1;
    overflow-y: auto; /* 保留滚动 */
    flex: 1;
    min-height: 0; /* 关键修复：允许内容收缩 */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
    scroll-behavior: smooth;
    /* 顶部和底部渐变遮罩 */
    mask-image: linear-gradient( to bottom, transparent 0%, black 20px, black calc(100% - 20px), transparent 100% );
    /* 滚动条轨道阴影 */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}
    /* Webkit 浏览器滚动条样式 (Chrome, Edge, Safari) */
    .message-list::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .message-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .message-list::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }

        .message-list::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }
/* 消息基础样式 - 移除不必要的定位 */
.message {
    max-width: 80%;
    padding: 12px;
    border-radius: 12px;
    position: relative;
    margin-bottom: 8px;
    z-index: auto;
    word-break: break-word; /* 更好的文字换行 */
}

    .message::after {
        content: "";
        display: table;
        clear: both;
    }
/* 用户消息 */
.user-message {
    align-self: flex-end;
    background-color: #007bff;
    color: white;
    margin-left: 20%; /* 防止与AI消息重叠 */
}

/* AI消息 */
.ai-message {
    align-self: flex-start;
    background-color: #e9ecef;
    color: #212529;
    margin-right: 20%; /* 防止与用户消息重叠 */
}

/* 基础样式 */
.styled-text {
    line-height: 1.5;
    font-size: 1rem;
}

    /* 加粗文本 */
    .styled-text strong,
    .styled-text .bold {
        font-weight: 600;
        color: var(--primary-text);
    }

    /* 斜体文本 */
    .styled-text em,
    .styled-text .italic {
        font-style: italic;
        opacity: 0.9;
    }

    /* 列表样式 */
    .styled-text ul {
        padding-left: 1.5rem;
        margin: 0.5rem 0;
        list-style-type: disc;
    }

    .styled-text li {
        margin-bottom: 0.25rem;
        padding-left: 0.5rem;
    }

    /* 引用样式 */
    .styled-text blockquote {
        border-left: 3px solid var(--primary-color);
        padding-left: 1rem;
        margin: 0.5rem 0;
        color: var(--secondary-text);
        font-style: italic;
    }

    /* 标题样式 */
    .styled-text h2 {
        font-size: 1.25rem;
        margin: 1rem 0 0.5rem 0;
        font-weight: 600;
        color: var(--primary-color);
    }

/* 消息内容 */
.message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5; /* 增加行高 */
    margin: 8px 0;
}

/* 发送者样式 */
.message-sender {
    font-weight: bold;
    font-size: 0.8em;
    margin-bottom: 4px;
}

/* 时间戳样式 */
.message-time {
    font-size: 0.7em;
    text-align: right;
    color: inherit;
    opacity: 0.7;
    margin-top: 4px;
}

.ai-response {
    white-space: pre-wrap;
    border-right: 2px solid #666; /* 光标效果 */
    animation: blink-caret 0.75s step-end infinite;
    min-height: 1em; /* 保持高度 */
}

@keyframes blink-caret {
    from, to {
        border-color: transparent
    }

    50% {
        border-color: #666;
    }
}

.loading-indicator {
    color: #666;
    font-size: 1.5rem;
    text-align: center;
    padding: 1rem;
}

.input-area {
    padding: 12px;
    border-top: 1px solid #ddd;
    background-color: white;
}

.message-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
}

.input-actions {
    display: flex;
    margin-top: 8px;
    gap: 8px;
}

.file-input {
    flex: 1;
}

.send-button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

    .send-button:hover {
        background-color: #0056b3;
    }
/*

 a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

app {
    position: relative;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.main {
    flex: 1;
}

    .main .top-row {
        background-color: #f7f7f7;
        border-bottom: 1px solid #d6d5d5;
        justify-content: flex-end;
    }

        .main .top-row > a, .main .top-row .btn-link {
            white-space: nowrap;
            margin-left: 1.5rem;
        }

.main .top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}*/
/*::-webkit-scrollbar {
    width: 0 !important;
    height: 0;
}
*/
.invisible-scrollbar::-webkit-scrollbar {
    display: none;
}

.sidebar {
    /*background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);*/
    height: 100%;
    background-color: aliceblue;
    color: black;
}

    .sidebar .top-row {
        background-color: rgba(0,0,0,0.4);
    }

    .sidebar .navbar-brand {
        font-size: 1.1rem;
    }

    .sidebar .oi {
        width: 2rem;
        font-size: 1.1rem;
        vertical-align: text-top;
        top: -2px;
    }

    .sidebar .nav-item {
        font-size: 0.9rem;
        padding-bottom: 0.5rem;
    }

        .sidebar .nav-item:first-of-type {
            padding-top: 1rem;
        }

        .sidebar .nav-item:last-of-type {
            padding-bottom: 1rem;
        }

        .sidebar .nav-item a {
            color: #d7d7d7;
            border-radius: 4px;
            height: 3rem;
            display: flex;
            align-items: center;
            line-height: 3rem;
        }

            .sidebar .nav-item a.active {
                background-color: rgba(255,255,255,0.25);
                color: white;
            }

            .sidebar .nav-item a:hover {
                background-color: rgba(255,255,255,0.1);
                color: white;
            }

/*.content {
    padding-top: 1.1rem;
}

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 767.98px) {
    .main .top-row:not(.auth) {
        display: none;
    }

    .main .top-row.auth {
        justify-content: space-between;
    }

    .main .top-row a, .main .top-row .btn-link {
        margin-left: 0;
    }
}*/
/*
@media (min-width: 768px) {
    app {
        flex-direction: row;
    }

    .sidebar {
        width: 200px;
        height: 100vh;
        position: sticky;
        top: 0;
        background-color:#fff;
    }

    .main .top-row {
        position: sticky;
        top: 0;
    }

    .main > div {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
         Never collapse the sidebar for wide screens
        display: block;
    }
}
*/
/*.nav-link{
    color:#000 !important;
}