x-tutor {
    display: block;
    font-size: 16px;
}

x-tutor .toasts {
    bottom: 8px;
    max-width: 264px;
    pointer-events: auto;
    position: fixed;
    right: 8px;
    transition: transform .4s;
    z-index: 300;
}

x-tutor .chat {
    background: #9fcdfa;
    border-radius: 12px 0 0 0;
    bottom: 0;
    box-shadow: 0 0 12px rgba(0, 0, 0, .25);
    display: none;
    flex-direction: column;
    height: 75%;
    max-height: calc(200vh - 44px);
    position: fixed;
    right: 0;
    width: 100%;
    max-width: 768px;
    z-index: 301;
}

/* PC端聊天窗口宽度限制 */
@media (min-width: 769px) {
    x-tutor .chat {
        width: 768px !important; /* PC端固定宽度768px */
    }
}

/* 移动端聊天窗口宽度调整 */
@media (max-width: 768px) and (orientation: portrait) {
    x-tutor .chat {
        width: 100% !important; /* 垂直屏幕时宽度100% */
        max-width: none !important; /* 移除最大宽度限制 */
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    x-tutor .chat {
        width: 70% !important; /* 水平屏幕时宽度70% */
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    x-tutor .chat {
        width: 70% !important; /* 小屏幕水平时也使用70%宽度 */
    }
}

x-tutor .msg-wrap {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
}

x-tutor .chat-header {
    background: #0b62b6;
    border-radius: 12px 0 0 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    height: 44px;
    line-height: 44px;
    padding: 0 12px;
}

x-tutor .chat-body {
    flex: 1 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 2px 8px 44px;
    position: relative;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

x-tutor .chat-footer {
    background: #fff;
    display: flex;
}

x-tutor .close {
    cursor: pointer;
    padding: 10px;
    position: absolute;
    right: 0;
    top: 0;
    transition: fill .2s, transform .2s;
    fill: hsla(0, 0%, 100%, .6);
}

x-tutor .chat-header x-icon[name=fox] {
    margin: 0 8px -9px 0;
}

/* 预设问题样式 */
x-tutor .preset-questions {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 5px;
    border-radius: 8px;
}

x-tutor .preset-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

x-tutor .preset-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

x-tutor .preset-btn {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    font-size: 15px;
    padding: 12px 12px;
    text-align: left;
    transition: all 0.2s ease;
    /* width: 100%; */
}

x-tutor .preset-btn:hover {
    background: #e3f2fd;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,123,255,0.15);
}

x-tutor .preset-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,123,255,0.15);
}

/* 移动端预设按钮样式调整 */
@media (max-width: 768px) {
    x-tutor .preset-questions {
        padding: 10px;
    }
    
    x-tutor .preset-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

x-tutor .msg-wrap {
    align-items: flex-end;
    display: flex
;
    flex-direction: column;
}

x-tutor .msg.incorrect {
    background: #b50c5a;
}
x-tutor .msg.hint {
    background: #0f82f2;
    color: hsla(0, 0%, 100%, .9);
}
x-tutor .msg.hint, x-tutor .msg.question {
    line-height: 1.4;
    padding: 5px 12px;
}
x-tutor .msg {
    border-radius: 16px 16px 3px 16px;
    margin-top: 6px;
    width: -moz-fit-content;
    width: fit-content;
}

x-tutor .msg p {
    margin: 0;
}

x-tutor .chat-footer .input {
    cursor: text;
    flex-grow: 1;
    line-height: 1.3;
    max-height: 64px;
    overflow: auto;
    padding: 10px 8px 10px 20px;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
    -webkit-user-modify: read-write-plaintext-only;
    color: #656073;
}

x-tutor .chat-footer .hint {
    cursor: pointer;
    fill: #656073;
    position: relative;
    transition: fill .2s;
    color: #000;
    font-size: 16px;
    border:1px solid #000;
    border-radius: 5px;
    height: 30px;
    width: 50px;
    margin-top: 5px;
    margin-left: 5px;
}

x-tutor .chat-footer .input:empty:before {
    color: #aaa;
    content: "请输入你的问题";
}

x-tutor .close:focus, x-tutor .close:hover {
    fill: #fff;
    transform: scale(1.4);
}
x-tutor .close {
    cursor: pointer;
    padding: 10px;
    position: absolute;
    right: 0;
    top: 0;
    transition: fill .2s, transform .2s;
    fill: hsla(0, 0%, 100%, .6);
}

x-tutor .msg.correct {
    background: #1e9620;
}

x-tutor .msg.archie {
    background: #0f82f2;
    border-radius: 28px 28px 3px 28px;
    padding: 10px 6px 6px 10px;
    transition: background .2s;
}

x-tutor .chat-footer .hint x-icon {
    display: block;
    padding: 8px;
    fill: #df0d0d;
}