.m365-copilot-page{max-width:960px}.m365-copilot-shell{overflow:hidden}.m365-copilot-messages{min-height:320px;max-height:58vh;overflow-y:auto;scroll-behavior:smooth}.m365-copilot-empty{color:var(--bs-secondary-color)}.m365-copilot-empty .ti{font-size:3rem;color:var(--bs-primary)}.m365-copilot-turn{display:flex;flex-direction:column;gap:12px;margin-bottom:20px}.m365-copilot-bubble{max-width:84%;padding:14px 16px;border-radius:12px;line-height:1.65;overflow-wrap:anywhere}.m365-copilot-user{align-self:flex-end;background:var(--bs-primary);color:#fff}.m365-copilot-assistant{align-self:flex-start;background:var(--bs-tertiary-bg);color:var(--bs-body-color)}.m365-copilot-error{align-self:flex-start;background:rgba(var(--bs-danger-rgb),.12);color:var(--bs-danger-text-emphasis)}.m365-copilot-label{font-size:.78rem;font-weight:700;margin-bottom:6px;opacity:.8}.m365-copilot-shell textarea{resize:vertical;min-height:96px}@media(max-width:575.98px){.m365-copilot-page{padding-left:12px;padding-right:12px}.m365-copilot-bubble{max-width:94%}.m365-copilot-messages{min-height:260px;max-height:52vh}}
.m365-copilot-layout{--m365-history-width:260px;position:relative;display:grid;grid-template-columns:var(--m365-history-width) minmax(0,1fr);min-height:520px;transition:grid-template-columns .2s ease}.m365-copilot-layout.is-history-collapsed{grid-template-columns:0 minmax(0,1fr)}.m365-copilot-history-toggle{position:absolute;z-index:5;top:14px;left:calc(var(--m365-history-width) - 14px);width:28px;height:28px;padding:0;border:1px solid var(--bs-border-color);border-radius:50%;display:flex;align-items:center;justify-content:center;transition:left .2s ease;box-shadow:0 1px 4px rgba(0,0,0,.08)}.is-history-collapsed .m365-copilot-history-toggle{left:10px}.m365-copilot-history{min-width:0;padding:16px;border-right:1px solid var(--bs-border-color);background:var(--bs-tertiary-bg);overflow:hidden}.is-history-collapsed .m365-copilot-history{padding-left:0;padding-right:0;border-right:0}.m365-copilot-main{min-width:0;padding:24px!important}.m365-copilot-history-title{font-size:.78rem;font-weight:700;color:var(--bs-secondary-color);margin:4px 4px 8px;text-transform:uppercase}.m365-copilot-history-list{display:flex;flex-direction:column;gap:6px;max-height:430px;overflow-y:auto}.m365-copilot-history-row{position:relative;border-radius:8px}.m365-copilot-history-row:hover{background:rgba(var(--bs-primary-rgb),.08)}.m365-copilot-history-row.active{background:rgba(var(--bs-primary-rgb),.14)}.m365-copilot-history-item{display:flex;flex-direction:column;gap:2px;padding:9px 36px 9px 10px;color:var(--bs-body-color);text-decoration:none}.m365-copilot-history-row.active .m365-copilot-history-item{color:var(--bs-primary)}.m365-copilot-history-item-title{font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.m365-copilot-history-item small{color:var(--bs-secondary-color)}.m365-copilot-history-delete{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:28px;height:28px;padding:0;display:flex;align-items:center;justify-content:center;color:var(--bs-danger);opacity:0;visibility:hidden}.m365-copilot-history-row:hover .m365-copilot-history-delete,.m365-copilot-history-row:focus-within .m365-copilot-history-delete{opacity:1;visibility:visible}.m365-copilot-history-delete:hover{background:rgba(var(--bs-danger-rgb),.12);color:var(--bs-danger)}
@media(max-width:767.98px){.m365-copilot-layout{grid-template-columns:1fr}.m365-copilot-layout.is-history-collapsed{grid-template-columns:1fr}.m365-copilot-history-toggle{left:auto;right:12px;top:12px}.is-history-collapsed .m365-copilot-history-toggle{left:auto;right:12px}.m365-copilot-history{border-right:0;border-bottom:1px solid var(--bs-border-color);max-height:240px;padding-top:48px}.is-history-collapsed .m365-copilot-history{display:none}.m365-copilot-history-list{max-height:150px}.m365-copilot-main{padding:20px!important}}
@keyframes m365-copilot-spin{to{transform:rotate(360deg)}}.m365-copilot-spin{display:inline-block;animation:m365-copilot-spin .8s linear infinite}
@media(prefers-reduced-motion:reduce){.m365-copilot-messages{scroll-behavior:auto}}

/* M365_LAYOUT_OVERRIDE_START */

/*
 * 原宽度 960px，左右各增加 150px，最终最大宽度 960px。
 * 原主体最小高度 520px，上方增加 20px、下方增加 40px，
 * 最终最小高度 490px。
 */
.m365-copilot-page {
    width: calc(100% - 24px) !important;
    max-width: 1200px !important;
    padding-top: 8px !important;
    padding-bottom: 24px !important;
}

.m365-copilot-shell {
    width: 100%;
}

/* 固定整体聊天主体高度，不再被消息内容撑高。 */
.m365-copilot-layout {
    height: clamp(675px, calc(100vh - 210px), 770px);
    min-height: 675px !important;
    max-height: 770px;
}

/* 左侧历史记录跟随主体高度。 */
.m365-copilot-history {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.m365-copilot-history-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto;
}

/* 右侧聊天区域使用固定的纵向弹性布局。 */
.m365-copilot-main {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 24px !important;
}

/*
 * 消息多少只影响内部滚动条，不影响聊天框整体高度。
 * 新对话、历史对话使用完全相同的聊天框尺寸。
 */
.m365-copilot-messages {
    flex: 1 1 0;
    width: 100%;
    height: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* 输入区域固定在聊天区域底部。 */
#m365-copilot-form {
    flex: 0 0 auto;
    width: 100%;
    margin-top: 20px !important;
}

/* 防止输入框被内容自动撑高。 */
#m365-copilot-prompt {
    height: 96px !important;
    min-height: 96px !important;
    max-height: 96px !important;
    resize: none !important;
}

/* 平板及手机自动适配。 */
@media (max-width: 767.98px) {
    .m365-copilot-page {
        width: calc(100% - 16px) !important;
        padding-top: 8px !important;
        padding-bottom: 24px !important;
    }

    .m365-copilot-layout {
        height: calc(100dvh - 130px);
        min-height: 520px !important;
        max-height: 760px;
    }

    .m365-copilot-main {
        padding: 18px !important;
    }

    #m365-copilot-prompt {
        height: 88px !important;
        min-height: 88px !important;
        max-height: 88px !important;
    }
}

/* M365_LAYOUT_OVERRIDE_END */
