body {
    margin: 0; padding: 0;
    font-family: Microsoft YaHei, system-ui, sans-serif;
}
a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #9fa1a8;
}
a:hover {
    color: #15e;
    text-decoration:none;
    border-bottom: 1px solid #15e;
}

@media(min-width:651px) { /* Desktop */
    .Main {
        width: 80%;
        max-width: 860px;
        margin: 32px auto;
        padding-top: 10px;
        font-size: 14px;
        border-radius: 20px;
        box-shadow: 0 0px #e5e5e5, 0 0 15px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.05);
        overflow: hidden;
    }
}
@media(max-width:650px) { /* Mobile */
    .Main {
        width: 100%;
        font-size: 14px;
    }
}

.Top {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    height: 30px;
    padding: 10px 30px;
    font-size: 20px;
    color: #d2d6dd;
    background-color: #fff;
    border-radius: 20px 20px 0px 0px;
    z-index: 99999;
}
.Nano {
    font-weight: bold;
    background-image: -webkit-linear-gradient(320deg, #00e2ff, #003cff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.Middle {
    /* max-width: 700px; */
    margin: 0 auto;
    display: flex;
    /* flex-direction: column;
    align-items: center; */
    overflow: hidden;
}


.Footer {
    padding: 10px 30px 10px 30px;
}
.Copyright {
    font-size: 12px;
    text-align: center;
    line-height: 3;
    color: #9a9ea8;
}








.ModalMask {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #ffffff80;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 999;
    display: none;
}
.Modal {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 600px;
    min-width: 360px;
    /* width: 50%; */
    margin: 0px auto 0 auto;
    padding: 0;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 5px 0 rgb(0 0 0 / 0.1);
    font-size: 13px;
    overflow: hidden;
    z-index: 1000;
    display: none;
}
.ModalThrobberContainer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffffcc;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}
.ModalBanner {
    width: 100%; height: 120px;
    background: linear-gradient(10deg, #92edff, #00aced, #005bcd, #000e8d, #101339, #000000, #0c0b10, #0f204e, #3673ad);
    color: #c1f1ff;
    /* border: 2px solid; */
    /* border-image: linear-gradient(40deg, #bde5ff, #515f69, #78b4e8) 1; */
    display: flex;
    margin-bottom: 10px;
    /* width: 100%;
    height: 120px;
    background-image: url(../res/banner.jpg);
    background-size: cover;
    background-position: center; */
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
}
.ModalBannerTitle {
    color: #ffffff;
    text-shadow: 1px 1px 3px black;
    font-size: 18px;
    font-weight: bold;
    margin: 20px;
    letter-spacing: 1px;
}
.ModalTitle {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 14px;
    color: #2a2b2f;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 2;
}
.ModalContent {
    padding: 10px 40px;
    box-sizing: border-box;
    width: 100%;
}

.ModelSelect {
    font-size: 14px;
    padding: 5px;
    width: 100%;
    outline: none;
    border: 2px solid #d8dce4;
    border-radius: 5px;
    color: #2a2b2f;
}

.SystemPromptList {
    display: flex;
}
.SystemPrompt {
    padding: 3px 8px;
    margin-right: 3px;
    font-size: 12px;
    border-radius: 5px;
    background: #eff0f5;
    color: #2a2b2f;
    cursor: pointer;
}

.SystemPromptInput {
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    resize: none;
    border: none;
    border: 2px solid #d8dce4;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.5;
    height: 60px;
    padding: 3px 5px;
    margin: 9px 0 0 0;
    width: 100%;
}
.SystemPromptInput::placeholder {
    color: #c3c8d1;
}

.ModalConfirm {
    display: inline-block;
    margin: 5px;
    padding: 8px 18px;
    font-size: 14px;
    border: none;
    color: #ffffff;
    background: #15e;
    border-radius: 6px;
}
.ModalConfirm:active {
    background: #0038b9;
    box-shadow: inset 1px 1px 3px 0px rgba(0, 0, 0, 0.5);
}
.ModalCancel {
    display: inline-block;
    margin: 5px;
    padding: 8px 18px;
    font-size: 14px;
    border: none;
    color: #2a2b2f;
    background: #e6e9ef;
    border-radius: 6px;
}
.ModalCancel:active {
    background: #ced2da;
    box-shadow: inset 1px 1px 3px 0px rgba(0, 0, 0, 0.5);
}



.SwitchButton {
    display: flex;
    font-size: 13px;
}
.SwitchButtonKey {
    padding: 2px 5px;
    margin: 3px;
    color: #a8abba;
    /* border: 1px dashed #c3c6cd; */
    border-radius: 5px;
    background: linear-gradient(180deg, #f6f7f9, #e0e2e7);
    cursor: pointer;
}
.SwitchButtonKey:first-child {
    margin: 3px 3px 3px 0;
}
.SwitchButtonKey:last-child {
    margin: 3px 0 3px 3px;
}
.SwitchButtonKey.Active {
    color: #fff;
    background: linear-gradient(180deg, #66ccff, #15e);
}

.RangeInput {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin: 5px 0;
    font-size: 13px;
}
.RangeInputTitle {
    width: 8em;
    margin-right: 10px;
    flex-shrink: 0;
}
.RangeInputControl {
    width: 100%;
}
.RangeInputValue {
    display: inline-block;
    width: 50px;
    margin-left: 10px;
    flex-shrink: 0;
}
















.Chat {
    position: relative;
    width: 100%;
    overflow-y: auto;
    /* background: linear-gradient(180deg, #ffffff 50%, #f9fbfe); */
    background: #ffffff;
}


@media(min-width:651px) { /* Desktop */
    .ChatRecord {
        padding: 10px 30px 30px 30px;
        min-height: calc(100% - 120px);
        text-align: center;
    }
}
@media(max-width:650px) { /* Mobile */
    .ChatRecord {
        padding: 10px 10px 30px 10px;
        min-height: calc(100% - 120px);
        text-align: center;
    }
}

.ButtonClearall {
    display: flex;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
}
.ButtonClearall:hover {
    background-color: #e5e9f2;
}

.Guide {
    display: flex;
    margin: 9px 0 20px 0;
    flex-direction: column;
    align-items: center;
}
.GuideIntroContainer {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid #cfd3dc;
    padding: 0; margin: 0 0 20px 10px;
    background-image: url("nano.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position-x: right;
}
.GuideIntro {
    display: flex;
    flex-direction: column;
    padding: 30px 90px 10px 20px;
}
.GuideIntroTitle {
    font-size: 16px;
    font-weight: bold;
    /* letter-spacing: 1px; */
    margin: 10px 0px 10px -10px;
    text-align: center;
    color: #394359;
}
.GuideIntroContent {
    font-size: 12px;
    color: #626675;
    margin: 10px 0;
    line-height: 1.8;
    text-align: left;
    letter-spacing: 0.5px;
}
.GuideQuestionContainer {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}
.GuideQuestion {
    border-radius: 5px;
    background: linear-gradient(0deg, #eff0f3, #ffffff);
    color: #656e83;
    margin: 5px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 0px;
    cursor: pointer;
}
.GuideQuestion:hover {
    background: linear-gradient(0deg, #e3e5e9, #ffffff);
}


#backend_switch, #tts_init {
    background-color: #ccd3e0;
    width: fit-content;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 3px;
    margin: 0px;
    font-size: 12px;
    cursor: pointer;
}


.ChatInfo {
    display: block;
    font-size: 12px;
    background-color: #e6e7eb;
    color: #9b9fa6;
    width: fit-content;
    padding: 2px 10px;
    margin: 5px auto;
    border-radius: 20px;
}

.ChatRound { display: flex; align-items: flex-start; text-align: left; margin: 8px 0; }

.UserRound { flex-direction: row; }
.BotRound { flex-direction: row; }

.ChatAvatarContainer {
    display: none;
    width: 30px; height: 30px; overflow: hidden; border-radius: 6px; flex-shrink: 0;
    border: 1px solid #fff;
    box-sizing: border-box;
    box-shadow: 1px 1px 6px 0px rgb(0 0 0 / 0.5);
}
.UserAvatarContainer {
    margin-right: 10px;
    margin-top: 4px;
}
.BotAvatarContainer {
    margin-right: 10px;
    margin-top: 4px;
}
.UserAvatarImage, .BotAvatarImage { width: 100%; height: 100%; }

.ChatBubble {
    font-size: 14px; line-height: 1.7; letter-spacing: 0.3px;
    margin: 8px 0;
    margin: 0px;
    border-radius: 10px;
    /* box-shadow: 1px 1px 6px 0px rgb(0 0 0 / 0.16); */
    overflow: hidden;
}
@media(min-width:651px) { /* Desktop */
    .UserBubble {
        color: #2a2b2f;
        /* background: linear-gradient(320deg, #50cfff, #678bff); */
        background: #15e1;
        margin: 15px 0 0 0px;
    }
}
@media(max-width:650px) { /* Mobile */
    .UserBubble {
        color: #2a2b2f;
        /* background: linear-gradient(320deg, #50cfff, #678bff); */
        background: #15e1;
        margin: 15px 0 0 0px;
        width: 100%;
    }
}

.BotBubble {
    color: #2a2b2f;
    /* background: #fff; */
    width: 100%;
}
.ChatContent {
    padding: 10px 15px;
}
.ChatContent :first-of-type { margin-top: 0; }
.ChatContent :last-of-type { margin-bottom: 0; }
.ChatContent p {
    margin: 12px 0;
}
.ChatContent blockquote {
    margin: 0px 0 12px 0px !important;
    border-left: 2px solid #ccd1db;
    padding-left: 12px;
    font-size: smaller;
}
.ChatContent pre {
    overflow: auto;
    font-size: smaller;
}

.ChatContent table {
    color: #2a2b2f;
    font-size: smaller;
    border-collapse: collapse;
    width: 100%;
    background-color: transparent;
    border-spacing: 0;
    box-shadow: 0 1px 1px 0 rgba(64,64,64,0.08), 0 1px 3px 1px rgba(64,64,64,0.16);
}
.ChatContent tr {
    border-bottom: 1px solid #f5f5f5;
}
.ChatContent td,
.ChatContent th {
    min-width: 4em;
    line-height: 21px;
    vertical-align: middle;
    text-align: center;
    padding: 5px;
}
/* 去掉表头和最后一行的横线 */
.ChatContent tr:last-child,
.ChatContent tr:first-child {
    border: none;
}
/* 表头样式（可直接改动） */
.ChatContent th {
    font-weight: bold;
    background-color: #f5f5f8;
}


.UserBubbleFooter, .BotBubbleFooter {
    display: flex;
    justify-content: space-between;
    padding: 0 5px 5px 15px;
    align-items: center;
}
.UserBubbleFooter { color: #aaaeba; }
.BotBubbleFooter { color:#aaaeba; }

.UserFooterInfo, .BotFooterInfo {
    font-size: 10px;
    margin-right: 10px;
}
.UserCopyBubble, .BotCopyBubble, .BotTTSBubble {
    display: flex;
    font-size: 11px;
    line-height: 1;
    flex-direction: row;
    align-items: center;
    background: none;
    padding: 3px;
    margin-left: 6px;
    border-radius: 3px;
    cursor: pointer;
}
.UserCopyBubble:hover { background: #2a2b2f10; }
.BotCopyBubble:hover { background: #2a2b2f10; }
.BotTTSBubble:hover { background: #2a2b2f10; }

.UserBubbleProgressBar {
    height: 2px;
    width: 0%;
    background-color: #15e;
}



.LoadModel {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.LoadLocalModelButton {
    position: relative;
    display: flex;
    border-radius: 6px;
    background: transparent;
    color: #ffffff;
    font-size: 15px;
    height: 30px;
    padding: 0px 20px;
    margin: 10px 0px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    cursor: default;
    color: #0b1221;
}

.LoadRemoteModelButton {
    position: relative;
    display: flex;
    border-radius: 6px;
    background: #1155ee;
    color: #ffffff;
    height: 40px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    cursor: default;
}
@media(min-width:651px) { /* Desktop */
    .LoadRemoteModelButton {
        margin: 0px 5px 10px 5px;
        padding: 3px 15px;
        font-size: 14px;
    }
}
@media(max-width:650px) { /* Mobile */
    .LoadRemoteModelButton {
        margin: 0px 5px 10px 5px;
        padding: 2px 8px;
        font-size: 12px;
    }
}
.LoadRemoteModelButton:hover {
    background: #002dc3;
}
.ChatInput {
    position: sticky;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 10px 0;
    /* background: #f9fbfe; */
    text-align: center;
}
@media(min-width:651px) { /* Desktop */
    .ChatInputContainer {
        display: flex;
        margin: 10px 30px;
    }
}
@media(max-width:650px) { /* Mobile */
    .ChatInputContainer {
        display: flex;
        margin: 10px;
    }
}

.InputBoxContainer {
    display: flex;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    background: #ffffff;
    width: 100%;
    padding: 10px;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 2px 2px 20px 3px rgb(0 0 0 / 0.12);
}
.InputBox {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 0.5px;
    line-height: 1.5;
    max-height: 200px;
    min-height: 20px;
    height: 20px;
    box-sizing: border-box;
}
.InputBox:disabled {
    background-color: #ffffff;
    color: #c3c8d1;
}
.InputBox::placeholder {
    color: #c3c8d1;
}

.ButtonClear, .ButtonSetting, .ButtonLoRA, .ButtonInstruct {
    display: flex;
    cursor: pointer;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 28px;
    border-radius: 10px;
    background-color: #e9eaef;
    padding: 0 6px;
}
.ButtonHover, .ButtonClear:hover, .ButtonSetting:hover, .ButtonInstruct:hover {
    background-color: #15e3;
}
.ButtonLoRA:hover, .ButtonLoRAHover { background-color: #d7eac0; }

.ButtonClearContainer { margin: 0; width: 16px; height: 16px; }

.ButtonSetting { margin: 0 8px 0 0; }
.ButtonSettingContainer { margin: 0; width: 20px; height: 20px; }

.ButtonLoRA { position: relative; margin: 0 8px 0 0; }
.ButtonLoRAContainer { margin: 0; width: 17px; height: 19px; }
.LoRAFileInput { position: absolute; top: 0; left: 0; width: 100%; height: 28px; opacity: 0; }

.ButtonInstruct { margin: 0; }
.ButtonInstructContainer { margin: 0; width: 24px; height: 20px; }

.ButtonSubmit {
    height: 40px;
    border: none;
    background: #15e;
    border-radius: 18px;
    color: #fff;
    min-width: 40px;
    flex-shrink: 0;
    margin: 1px 0 1px 10px;
    box-shadow: 2px 2px 6px 0px rgba(0, 0, 0, 0.1);
}
.ButtonSubmit:active {
    background: #0038b9;
    padding: 2px 0 0 2px;
    box-shadow: inset 2px 2px 6px 0px rgba(0, 0, 0, 0.5);
}
.ButtonSubmit:disabled {
    background: #babdc4;
    color: #fff;
    padding: 2px 0 0 2px;
    box-shadow: none;
}

.ButtonInterrupt {
    background-color: #d43030;
    color: #ffffff;
    box-shadow: 2px 2px 6px 0px rgb(0 0 0 / 25%);
    font-size: 12px;
}
.ButtonInterrupt:active {
    background-color: #a41818;
    color: #ffffff;
    padding: 2px 0 0 2px;
    box-shadow: inset 2px 2px 6px 0px rgb(0 0 0 / 25%);
}

.ButtonPTT {
    height: 40px;
    border: none;
    background: #87c800;
    border-radius: 18px;
    color: #fff;
    min-width: 40px;
    flex-shrink: 0;
    margin: 1px 0 1px 10px;
    box-shadow: 2px 2px 6px 0px rgba(0, 0, 0, 0.1);
}
.ButtonPTT:active, .ButtonPTT_Active {
    background: #5f8f00;
    padding: 1px 0 0 1px;
    box-shadow: inset 2px 2px 6px 0px rgba(0, 0, 0, 0.5);
}


