/**
 * [INPUT]: tutor.js 生成的导师浮窗、消息列表和 composer；继承 styles.css 的基础按钮与 Markdown
 * [OUTPUT]: 可收起/放大的响应式聊天窗口、可读消息与代码、触屏和键盘焦点样式
 * [POS]: public 的导师专属样式，随 tutor-window.js 的窗口状态扩展而不改全站布局
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */
.tutor-window{width:460px;height:650px;min-width:320px;min-height:370px;right:24px;bottom:24px;border-radius:18px;box-shadow:0 20px 80px #21396a2e,0 3px 18px #21396a14;z-index:40;max-height:calc(100dvh - 24px);max-width:calc(100vw - 16px)}
.tutor-window[hidden],.tutor-launcher[hidden],.chat-scroll-latest[hidden],.chat-wait[hidden]{display:none!important}
.tutor-window.is-maximized{inset:20px!important;width:min(1080px,calc(100vw - 40px))!important;height:calc(100dvh - 40px)!important;margin:auto;resize:none}
.tutor-title{padding:13px 14px 12px 18px;flex-shrink:0;gap:12px;min-height:65px}
.tutor-title strong{font-size:15px;letter-spacing:.02em;color:#2b4671}
.tutor-title-caption{display:block;font-size:10px;font-weight:400;margin-top:3px;color:#8b9ab1}
.tutor-title:focus-visible{outline:2px solid #386be7;outline-offset:-3px}
.tutor-tools{gap:3px}
.tutor-tools .icon-button{height:34px;width:34px;display:grid;place-items:center;border:0;background:transparent;color:#6f809b;font-size:21px;border-radius:7px;cursor:pointer}
.tutor-tools .icon-button:hover{background:#e6edfa;color:#294f99}
.chat-boundary{font-size:10px;padding:8px 18px;margin:0;flex-shrink:0;letter-spacing:.01em}
.chat-messages{min-height:0;padding:20px 18px 12px;gap:22px;overscroll-behavior:contain;scrollbar-gutter:stable;scroll-behavior:auto}
.chat-message{display:flex;flex-direction:column;gap:5px;min-width:0;max-width:100%;flex-shrink:0}
.chat-message.user{align-items:flex-end;margin-left:28px}
.chat-message.assistant{align-items:flex-start}
.chat-speaker{font-size:10px;line-height:1.5;color:#91a0b8;padding:0 4px}
.chat-bubble{font-size:13px;line-height:1.9;max-width:100%;width:fit-content;padding:13px 15px;color:#354967;border-radius:12px;min-width:0}
.chat-bubble.assistant{background:#f5f7fb;border:1px solid #edf0f6}
.chat-bubble.user{max-width:100%;background:#eaf0ff;color:#254b89;border-bottom-right-radius:3px}
.chat-bubble p{margin:0 0 10px}
.chat-bubble p:last-child{margin-bottom:0}
.chat-bubble h3,.chat-bubble h4{font-size:14px;line-height:1.6;color:#273d60;margin:12px 0 6px}
.chat-bubble .markdown-code{position:relative;white-space:pre;overflow-x:auto;max-width:100%;border:1px solid #dce4ef;border-radius:8px;padding:38px 12px 12px;background:#edf2f9;font-size:12px}
.chat-bubble .markdown-code code{font-size:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.chat-copy-code{position:absolute;top:7px;right:8px;border:1px solid #d6deec;background:#f9fbff;border-radius:4px;padding:3px 7px;color:#6a7f9f;font-size:10px;cursor:pointer}
.chat-bubble .markdown-table{max-width:100%;-webkit-overflow-scrolling:touch}
.chat-message-actions{display:flex;padding-left:4px}
.chat-message-actions .text-button{font-size:10px;color:#91a0b8}
.chat-message-actions .text-button:hover{color:#386be7}
.chat-scroll-latest{align-self:center;z-index:1;background:#fff;border:1px solid #dce4f2;border-radius:20px;box-shadow:0 3px 12px #21396a12;font-size:11px;color:#526e98;padding:7px 13px;margin:2px 0 8px;cursor:pointer}
.chat-wait{display:flex;align-items:center;gap:7px;flex-shrink:0;font-size:11px;padding:6px 18px 12px;color:#8293af}
.chat-wait button{margin-left:auto;font-size:11px;border:1px solid #e1e7f0;background:white;border-radius:6px;padding:5px 9px;color:#6d7f9c;cursor:pointer}
.chat-thinking{font-size:8px;letter-spacing:2px;color:#8ca8df;animation:tutor-pulse 1.4s ease-in-out infinite}
.tutor-error{font-size:11px;max-height:105px;overflow:auto;flex-shrink:0;padding:8px 18px 12px;line-height:1.7;margin:0}
.tutor-input{padding:12px 14px 13px;background:#fff;flex-shrink:0}
.tutor-input textarea{display:block;width:100%;min-height:48px;max-height:176px;font-size:13px;line-height:1.7;border-radius:10px;padding:11px 12px;background:#fbfcff;resize:none;transition:border-color .15s;box-sizing:border-box}
.tutor-input textarea:focus{border-color:#7b9eea;box-shadow:0 0 0 3px #386be70b}
.tutor-send-row{gap:8px;margin-top:9px}
.tutor-send-row span{font-size:9px;color:#a0adbf;flex:1;text-align:right}
.tutor-send-row .text-button{font-size:10px;color:#9aa8bd}
.tutor-send-row .button{font-size:11px;border-radius:8px;min-height:34px;padding:7px 12px}
.tutor-launcher{position:fixed;right:24px;bottom:24px;z-index:40;display:flex;align-items:center;gap:9px;border:1px solid #d8e3f6;background:#fff;color:#31578f;border-radius:28px;padding:13px 19px;box-shadow:0 8px 30px #21396a20;font-size:13px;cursor:pointer}
.tutor-launcher>span:first-child{font-size:21px;color:#527adb}
.tutor-launcher-state{font-size:10px;color:#91a0b8}
.tutor-window button:focus-visible,.tutor-launcher:focus-visible{outline:2px solid #386be7;outline-offset:2px}
@keyframes tutor-pulse{0%,100%{opacity:.45}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){.chat-thinking{animation:none}.tutor-input textarea{transition:none}}
@media(max-width:600px){
 .tutor-window{width:calc(100vw - 16px);height:min(680px,calc(100dvh - 16px));right:8px;bottom:8px;min-width:0;max-height:calc(100dvh - 16px);border-radius:14px;resize:none}
 .tutor-window.is-maximized{inset:0!important;width:100vw!important;height:100dvh!important;max-width:100vw;max-height:100dvh;border-radius:0}
 .tutor-title{padding:11px 12px 11px 15px;min-height:64px}
 .tutor-tools .icon-button{width:38px;height:38px}
 .chat-messages{padding:17px 12px 12px;gap:18px}
 .chat-bubble{font-size:14px;padding:11px 13px}
 .tutor-input textarea{font-size:16px}
 .tutor-send-row .button{min-height:40px;min-width:64px}
 .tutor-send-row>span{font-size:8px}
 .tutor-launcher{right:12px;bottom:calc(12px + env(safe-area-inset-bottom));padding:12px 17px}
 .chat-boundary{padding:8px 15px}
}
