:root{--bg-main:#E8E8E5;--bg-card:#F5F0F0;--bg-white:#FEFCF9;--text-main:#4F3F35;--text-sub:#8F7A6B;--text-light:#A09080;--accent:#D9CEC3;--border:#E9DFD5;--success:#CFE0D0;--warning:#EAC8B0;--danger:#EAD5CD;--info:#BFCEE0;--radius-lg:24px;--radius-md:16px;--radius-sm:12px;--shadow:0 8px 30px rgba(0,0,0,0.08);--chat-font-size:15px;}
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{height:100%;overflow:hidden;}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,system-ui,sans-serif;background:var(--bg-main);display:flex;justify-content:center;align-items:center;min-height:100vh;min-height:100dvh;}
.chat-app{width:100%;max-width:800px;height:100vh;height:100dvh;max-height:100dvh;background:var(--bg-card);display:flex;flex-direction:column;position:relative;box-shadow:var(--shadow);overflow:hidden;}
@media(min-width:768px){.chat-app{margin:16px;height:calc(100vh - 32px);border-radius:var(--radius-lg);}}
.chat-header{padding:10px 14px;background:var(--bg-card);display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border);flex-shrink:0;z-index:10;gap:6px;}
.header-left{display:flex;align-items:center;gap:8px;min-width:0;}
.brand-avatar{width:40px;height:40px;border-radius:50%;position:relative;cursor:pointer;flex-shrink:0;background:var(--bg-white);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:20px;}
.brand-avatar>img{width:40px;height:40px;border-radius:50%;object-fit:cover;}
.brand-avatar .emo-badge-img{position:absolute;width:18px;height:18px;bottom:-3px;right:-4px;border-radius:50%;background:var(--bg-white);border:1.5px solid var(--bg-white);box-shadow:0 1px 3px rgba(0,0,0,.2);object-fit:cover;}
.header-controls{display:flex;align-items:center;gap:6px;flex-shrink:0;}
.emotion-pill{font-size:11px;padding:4px 8px;border-radius:14px;background:var(--bg-white);border:1px solid var(--border);color:var(--text-sub);display:flex;align-items:center;gap:3px;white-space:nowrap;flex-shrink:0;}
.input-emotion{padding:3px 7px;font-size:13px;align-self:center;}
.icon-btn{width:36px;height:36px;border-radius:50%;border:none;background:var(--bg-white);color:var(--text-sub);font-size:16px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;flex-shrink:0;}
.icon-btn:active{transform:scale(.92);background:var(--accent);}
.icon-btn.voice-off{background:#EAD5D5;color:#B07;opacity:.7;}
.icon-btn.model-active{background:var(--accent);color:var(--text-main);}
.model-popover{position:absolute;top:58px;left:14px;background:var(--bg-white);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow);z-index:600;display:none;flex-direction:column;max-height:60vh;overflow-y:auto;min-width:220px;padding:6px;}
.model-popover.show{display:flex;}
.model-popover .mp-item{padding:9px 12px;border-radius:10px;font-size:12px;color:var(--text-main);cursor:pointer;display:flex;align-items:center;gap:6px;}
.model-popover .mp-item:hover{background:var(--bg-card);}
.model-popover .mp-item.sel{background:var(--accent);font-weight:600;}
/* 情绪弹窗：顶部居中，由大到小慢慢淡出，6 秒 */
.emotion-burst{position:fixed;top:calc(64px + env(safe-area-inset-top));left:50%;transform:translate(-50%,0) scale(1);z-index:4000;display:flex;flex-direction:column;align-items:center;gap:10px;opacity:0;pointer-events:none;}
.emotion-burst.show{animation:emoBurst 6s ease forwards;}
.emotion-burst img{width:min(62vw,300px);height:min(62vw,300px);object-fit:contain;filter:drop-shadow(0 10px 26px rgba(0,0,0,.32));border-radius:26px;}
.emotion-burst .bl{font-size:15px;color:var(--text-main);background:var(--bg-white);padding:5px 18px;border-radius:16px;box-shadow:var(--shadow);}
@keyframes emoBurst{
  0%{opacity:0;transform:translate(-50%,0) scale(1.3);}
  8%{opacity:1;transform:translate(-50%,0) scale(1.25);}
  30%{opacity:1;transform:translate(-50%,0) scale(1.1);}
  100%{opacity:0;transform:translate(-50%,0) scale(.25);}
}
.search-bar{display:none;padding:8px 14px;background:var(--bg-card);border-bottom:1px solid var(--border);gap:8px;align-items:center;}
.search-bar.show{display:flex;}
.search-bar input{flex:1;padding:8px 12px;border-radius:18px;border:1px solid var(--border);background:var(--bg-white);font-size:13px;outline:none;}
.search-nav{font-size:11px;color:var(--text-sub);white-space:nowrap;}
.search-bar button{border:none;background:var(--bg-white);border:1px solid var(--border);border-radius:10px;width:30px;height:30px;cursor:pointer;color:var(--text-sub);}
mark{background:#F5E1A8;color:#5C3F2A;border-radius:3px;padding:0 1px;}
.hl-current{outline:2px solid var(--warning);border-radius:14px;}
.settings-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);backdrop-filter:blur(4px);z-index:1000;display:none;align-items:center;justify-content:center;}
.settings-overlay.show{display:flex;}
.settings-container{background:var(--bg-white);border-radius:var(--radius-lg);width:95%;max-width:750px;height:85vh;max-height:720px;display:flex;overflow:hidden;box-shadow:var(--shadow);animation:slideUp .3s ease;}
@keyframes slideUp{from{opacity:0;transform:translateY(20px);}to{opacity:1;transform:translateY(0);}}
.settings-sidebar{width:150px;background:var(--bg-card);border-right:1px solid var(--border);display:flex;flex-direction:column;flex-shrink:0;}
.sidebar-header{padding:12px 10px;font-size:12px;font-weight:600;color:var(--text-main);border-bottom:1px solid var(--border);}
.sidebar-list{flex:1;overflow-y:auto;padding:6px;}
.sidebar-item{padding:8px 10px;border-radius:var(--radius-sm);margin-bottom:2px;font-size:11px;color:var(--text-main);cursor:pointer;transition:.15s;display:flex;align-items:center;gap:6px;white-space:nowrap;position:relative;}
.sidebar-item:hover{background:var(--accent);}
.sidebar-item.active{background:var(--accent);font-weight:600;}
.sidebar-item-icon{font-size:13px;flex-shrink:0;}
.sidebar-item-name{flex:1;overflow:hidden;text-overflow:ellipsis;}
.sidebar-item-lock{font-size:10px;flex-shrink:0;opacity:.6;}
.sidebar-item-del{opacity:0;width:18px;height:18px;border-radius:50%;border:none;background:var(--danger);color:#8B5A4B;font-size:11px;cursor:pointer;flex-shrink:0;}
.sidebar-item:hover .sidebar-item-del{opacity:1;}
.sidebar-add{padding:10px;border-top:1px solid var(--border);font-size:11px;color:var(--text-sub);cursor:pointer;text-align:center;}
.sidebar-add:hover{background:var(--success);}
.settings-detail{flex:1;display:flex;flex-direction:column;overflow:hidden;}
.detail-header{padding:12px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;}
.detail-header h2{font-size:14px;font-weight:600;color:var(--text-main);}
.detail-body{flex:1;overflow-y:auto;padding:14px 16px;}
.form-group{margin-bottom:12px;}
.form-label{font-size:10px;color:var(--text-sub);margin-bottom:4px;display:block;font-weight:500;text-transform:uppercase;}
.form-input{width:100%;padding:8px 10px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg-white);font-size:12px;outline:none;}
.form-input:focus{border-color:var(--text-sub);}
.form-input:disabled{background:#EEE8E2;color:var(--text-light);}
.form-hint{font-size:9px;color:var(--text-light);margin-top:2px;line-height:1.5;}
.input-with-btn{display:flex;gap:5px;}
.input-with-btn input,.input-with-btn select{flex:1;}
.input-with-btn button{padding:0 10px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg-card);color:var(--text-main);font-size:11px;cursor:pointer;white-space:nowrap;}
.list-row{display:flex;gap:5px;align-items:center;margin-bottom:5px;}
.list-row input[type=text]{flex:1;padding:7px 10px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg-white);font-size:12px;outline:none;}
.list-row .del-x{width:28px;height:30px;border-radius:8px;border:none;background:var(--danger);color:#8B5A4B;cursor:pointer;font-size:12px;flex-shrink:0;}
.list-row .sel-radio{flex-shrink:0;}
.list-row .res-label{font-size:11px;color:var(--text-sub);min-width:30px;}
.switch-row{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid var(--border);}
.switch-info{flex:1;}
.switch-label{font-size:12px;color:var(--text-main);font-weight:500;}
.switch-desc{font-size:9px;color:var(--text-light);margin-top:2px;}
.switch{position:relative;width:40px;height:22px;flex-shrink:0;}
.switch input{opacity:0;width:0;height:0;}
.switch-slider{position:absolute;cursor:pointer;inset:0;background:var(--border);border-radius:22px;transition:.3s;}
.switch-slider:before{position:absolute;content:"";height:16px;width:16px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:.3s;}
.switch input:checked+.switch-slider{background:var(--success);}
.switch input:checked+.switch-slider:before{transform:translateX(18px);}
.slider-row{padding:10px 0;border-bottom:1px solid var(--border);}
.slider-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
.slider-label{font-size:12px;color:var(--text-main);font-weight:500;}
.slider-value{font-size:12px;color:var(--text-sub);font-weight:600;}
input[type=range]{width:100%;-webkit-appearance:none;height:4px;border-radius:4px;background:var(--border);outline:none;}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:18px;height:18px;border-radius:50%;background:var(--accent);cursor:pointer;border:2px solid var(--bg-white);box-shadow:0 1px 3px rgba(0,0,0,.2);}
input[type=range]:disabled{opacity:.4;}
.avatar-upload-row{display:flex;gap:16px;padding:10px 0;border-bottom:1px solid var(--border);}
.avatar-upload-item{display:flex;flex-direction:column;align-items:center;gap:6px;}
.avatar-preview{width:56px;height:56px;border-radius:50%;border:2px solid var(--border);background:var(--bg-card);display:flex;align-items:center;justify-content:center;font-size:26px;cursor:pointer;overflow:hidden;}
.avatar-preview img{width:100%;height:100%;object-fit:cover;}
.avatar-caption{font-size:10px;color:var(--text-sub);}
.avatar-clear{font-size:9px;color:#8B5A4B;cursor:pointer;}
.bg-preview{width:100%;height:80px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg-card) center/cover no-repeat;display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--text-sub);cursor:pointer;}
.stat-box{background:var(--bg-card);border-radius:var(--radius-sm);padding:10px 12px;margin:8px 0;font-size:12px;color:var(--text-main);display:flex;justify-content:space-between;align-items:center;}
.stat-box b{color:var(--text-sub);}
.model-section-header{display:flex;justify-content:space-between;align-items:center;margin:14px 0 8px;padding-top:10px;border-top:1px solid var(--border);}
.model-section-header span{font-size:10px;color:var(--text-sub);font-weight:600;text-transform:uppercase;}
.model-actions{display:flex;gap:4px;}
.model-actions button{padding:3px 7px;border-radius:5px;border:none;background:var(--bg-card);color:var(--text-sub);font-size:10px;cursor:pointer;}
.model-list{display:flex;flex-direction:column;gap:5px;}
.model-card{padding:8px 10px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg-white);display:flex;justify-content:space-between;align-items:center;cursor:pointer;transition:.15s;}
.model-card:hover{border-color:var(--text-sub);}
.model-card.selected{border-color:var(--text-main);background:var(--accent);}
.model-info{flex:1;}
.model-name{font-size:12px;font-weight:500;color:var(--text-main);}
.model-meta{font-size:9px;color:var(--text-light);display:flex;gap:5px;}
.model-card-actions{display:flex;gap:3px;}
.model-card-actions button{width:22px;height:22px;border-radius:4px;border:none;background:var(--bg-card);color:var(--text-sub);cursor:pointer;font-size:11px;}
.action-buttons{margin-top:14px;padding-top:12px;border-top:1px solid var(--border);display:flex;flex-wrap:wrap;gap:6px;}
.action-buttons .btn{padding:6px 12px;border-radius:18px;border:none;font-size:11px;font-weight:500;cursor:pointer;}
.btn-primary{background:var(--accent);color:var(--text-main);}.btn-warning{background:var(--warning);color:#5C3F2A;}.btn-success{background:var(--success);color:#3E4A3A;}.btn-danger{background:var(--danger);color:#8B5A4B;}.btn-info{background:var(--info);color:#3A3E4A;}
.detail-footer{padding:10px 16px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:6px;}
.footer-btn{padding:7px 16px;border-radius:18px;border:none;font-size:11px;font-weight:500;cursor:pointer;}
.footer-btn-secondary{background:var(--bg-card);color:var(--text-main);}.footer-btn-primary{background:var(--accent);color:var(--text-main);}
.memo-panel{position:fixed;inset:0;background:rgba(0,0,0,.4);backdrop-filter:blur(4px);z-index:1000;display:none;align-items:center;justify-content:center;}
.memo-panel.show{display:flex;}
.memo-container{background:var(--bg-white);border-radius:var(--radius-lg);width:90%;max-width:500px;max-height:80vh;display:flex;flex-direction:column;box-shadow:var(--shadow);}
.memo-header{padding:14px 18px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;}
.memo-header h3{font-size:15px;font-weight:600;color:var(--text-main);}
.memo-body{flex:1;padding:14px 18px;overflow-y:auto;}
.memo-textarea{width:100%;min-height:180px;padding:10px;border-radius:var(--radius-sm);border:1px solid var(--border);font-size:13px;line-height:1.6;resize:vertical;outline:none;}
.memo-footer{padding:10px 18px;border-top:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;}
.memo-status{font-size:10px;color:var(--text-light);}
.chat-messages{flex:1;overflow-y:auto;padding:16px 18px;display:flex;flex-direction:column;gap:18px;scroll-behavior:smooth;}
.chat-messages::-webkit-scrollbar{width:4px;}
.chat-messages::-webkit-scrollbar-thumb{background:var(--accent);border-radius:4px;}
.message{display:flex;gap:8px;max-width:90%;align-items:flex-start;animation:fadeIn .25s ease;position:relative;}
.user-message{align-self:flex-end;flex-direction:row-reverse;}
.ai-message{align-self:flex-start;}
@keyframes fadeIn{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}
.msg-check{display:none;width:20px;height:20px;flex-shrink:0;margin-top:8px;cursor:pointer;}
.chat-messages.select-mode .msg-check{display:block;}
.avatar{width:36px;height:36px;border-radius:50%;flex-shrink:0;object-fit:cover;box-shadow:0 1px 3px rgba(0,0,0,.08);}
.avatar-emoji{display:flex;align-items:center;justify-content:center;font-size:20px;background:var(--bg-white);border:1px solid var(--border);}
.msg-content{display:flex;flex-direction:column;min-width:0;}
.user-message .msg-content{align-items:flex-end;}
.bubbles{display:flex;flex-direction:column;}
.user-message .bubbles{align-items:flex-end;}
.bubble{padding:13px 18px;border-radius:22px;font-size:var(--chat-font-size);line-height:1.55;word-break:break-word;white-space:pre-wrap;box-shadow:0 1px 1.5px rgba(0,0,0,.02);cursor:pointer;max-width:100%;}
/* 多气泡：换行拆分后的相邻气泡间距 */
.bubbles .bubble+.bubble{margin-top:5px;}
.user-message .bubble{background:#F2E3E3;color:#2C2C2C;border-bottom-right-radius:6px;}
.ai-message .bubble{background:#F0E8E8;color:#2C2C2C;border:1px solid #E8DCD2;border-bottom-left-radius:6px;}
.bubble.proactive{border-left:3px solid var(--warning);}
.bubble.compressed{border-left:3px solid var(--info);background:#EAEFF5;}
.bubble.editing{outline:2px solid var(--accent);cursor:text;}
.inline-speak{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;border:1px solid var(--border);background:var(--bg-white);color:var(--text-sub);font-size:10px;cursor:pointer;margin-left:6px;vertical-align:middle;}
.inline-speak.playing{background:var(--success);color:#3E4A3A;}
.image-bubble{padding:6px;background:#F2E3E3;border-radius:18px;}
.image-bubble img{max-width:220px;border-radius:12px;display:block;cursor:pointer;}
.msg-time{font-size:10px;color:var(--text-light);margin-top:5px;}
.thinking-block{background:#EFE9E2;border-left:3px solid var(--accent);border-radius:10px;padding:8px 12px;font-size:12px;color:var(--text-sub);margin-bottom:6px;white-space:pre-wrap;line-height:1.5;}
.recall-chip{font-size:10px;color:var(--text-sub);background:#EAF0EA;border:1px solid #D5E2D5;border-radius:10px;padding:4px 8px;margin-bottom:6px;display:none;align-items:center;gap:4px;max-width:100%;}
.recall-chip.show{display:inline-flex;}
.msg-actions{display:flex;gap:4px;margin-top:5px;opacity:0;transition:opacity .2s;}
.message:hover .msg-actions{opacity:1;}
.msg-actions button{width:26px;height:26px;border-radius:8px;border:1px solid var(--border);background:var(--bg-white);color:var(--text-sub);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;}
.msg-actions button:active{transform:scale(.9);background:var(--accent);}
.loading-dots{display:flex;gap:3px;padding:4px 0;}
.loading-dots span{width:6px;height:6px;background:#CBBBAE;border-radius:50%;animation:bounce 1.2s infinite;}
.loading-dots span:nth-child(2){animation-delay:.2s;}.loading-dots span:nth-child(3){animation-delay:.4s;}
@keyframes bounce{0%,60%,100%{transform:translateY(0);}30%{transform:translateY(-5px);}}
.context-menu{position:fixed;background:var(--bg-white);border-radius:14px;padding:6px;box-shadow:var(--shadow);border:1px solid var(--border);z-index:2500;display:none;flex-direction:column;min-width:120px;}
.context-menu.show{display:flex;}
.context-menu button{padding:9px 14px;border:none;background:transparent;text-align:left;font-size:13px;cursor:pointer;color:var(--text-main);border-radius:8px;display:flex;align-items:center;gap:8px;}
.context-menu button:hover{background:var(--bg-card);}
.context-menu button.danger{color:#8B5A4B;}
.select-bar{display:none;padding:8px 14px;background:var(--bg-white);border-bottom:1px solid var(--border);gap:8px;align-items:center;}
.select-bar.show{display:flex;}
.select-bar .sb-info{flex:1;font-size:12px;color:var(--text-sub);}
.select-bar button{padding:6px 12px;border-radius:14px;border:1px solid var(--border);background:var(--bg-card);font-size:11px;cursor:pointer;color:var(--text-main);}
.select-bar button.danger{background:var(--danger);color:#8B5A4B;}
.quote-preview{display:none;background:var(--bg-white);border-left:3px solid var(--accent);border-radius:8px;padding:8px 12px;margin:0 14px 8px;font-size:12px;color:var(--text-sub);align-items:center;justify-content:space-between;}
.quote-preview.show{display:flex;}
.quote-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.quote-close{border:none;background:none;color:var(--text-light);cursor:pointer;font-size:14px;padding:0 4px;}
.input-wrapper{padding:10px 14px;background:var(--bg-card);border-top:1px solid var(--border);display:flex;align-items:flex-end;gap:6px;padding-bottom:max(10px,env(safe-area-inset-bottom));}
.input-container{flex:1;min-width:0;background:var(--bg-white);border-radius:20px;padding:3px 12px;display:flex;align-items:center;border:1px solid var(--border);}
.input-container textarea{flex:1;border:none;background:transparent;padding:8px 0;font-size:14px;outline:none;resize:none;max-height:80px;font-family:inherit;line-height:1.4;}
.send-btn{background:var(--accent);border:none;}
.send-btn:disabled{opacity:.4;}
.mic-btn{touch-action:none;user-select:none;-webkit-user-select:none;}
.mic-btn.recording{background:#E8A8A8;color:#fff;animation:micPulse 1s infinite;}
@keyframes micPulse{0%,100%{box-shadow:0 0 0 0 rgba(232,168,168,.5);}50%{box-shadow:0 0 0 6px rgba(232,168,168,0);}}
.action-menu{position:fixed;bottom:70px;left:14px;background:var(--bg-white);border-radius:var(--radius-md);box-shadow:var(--shadow);display:none;flex-direction:column;border:1px solid var(--border);overflow:hidden;z-index:100;}
.action-menu.show{display:flex;}
.action-menu button{padding:10px 14px;border:none;background:transparent;text-align:left;font-size:12px;cursor:pointer;color:var(--text-main);}
.action-menu button:hover{background:var(--bg-card);}
.image-viewer{position:fixed;inset:0;background:rgba(0,0,0,.9);display:flex;align-items:center;justify-content:center;z-index:2000;visibility:hidden;opacity:0;transition:.2s;cursor:pointer;}
.image-viewer.show{visibility:visible;opacity:1;}
.image-viewer img{max-width:90%;max-height:85%;border-radius:10px;}
.toast{position:fixed;bottom:100px;left:50%;transform:translateX(-50%);background:var(--success);color:#3E4A3A;padding:8px 18px;border-radius:18px;font-size:12px;box-shadow:var(--shadow);opacity:0;transition:opacity .3s;z-index:3000;}
.toast.show{opacity:1;}
.imggen-panel{position:fixed;inset:0;background:rgba(0,0,0,.4);backdrop-filter:blur(4px);z-index:1200;display:none;align-items:center;justify-content:center;}
.imggen-panel.show{display:flex;}
.imggen-box{background:var(--bg-white);border-radius:var(--radius-lg);width:90%;max-width:440px;max-height:85vh;overflow-y:auto;padding:18px;box-shadow:var(--shadow);}
.imggen-box h3{font-size:15px;color:var(--text-main);margin-bottom:12px;}
.imggen-box textarea{width:100%;min-height:70px;padding:10px;border-radius:var(--radius-sm);border:1px solid var(--border);font-size:13px;resize:vertical;outline:none;font-family:inherit;}
.imggen-initprev{margin-top:8px;display:none;align-items:center;gap:8px;}
.imggen-initprev.show{display:flex;}
.imggen-initprev img{width:54px;height:54px;object-fit:cover;border-radius:8px;}
.imggen-actions{display:flex;gap:8px;margin-top:14px;justify-content:flex-end;}
.call-overlay{position:fixed;inset:0;background:linear-gradient(160deg,#E6DCD0,#D9CEC3);z-index:3500;display:none;flex-direction:column;align-items:center;justify-content:center;gap:20px;}
.call-overlay.show{display:flex;}
.call-avatar{width:120px;height:120px;border-radius:50%;background:var(--bg-white);display:flex;align-items:center;justify-content:center;font-size:60px;box-shadow:var(--shadow);overflow:hidden;}
.call-avatar img{width:100%;height:100%;object-fit:cover;}
.call-avatar.speaking{animation:callPulse 1s infinite;}
@keyframes callPulse{0%,100%{box-shadow:0 0 0 0 rgba(143,122,107,.4);}50%{box-shadow:0 0 0 18px rgba(143,122,107,0);}}
.call-status{font-size:16px;color:var(--text-main);font-weight:500;}
.call-timer{font-size:13px;color:var(--text-sub);min-height:16px;letter-spacing:.5px;}
.call-sub{font-size:12px;color:var(--text-sub);max-width:80%;text-align:center;min-height:18px;}
.call-controls{display:flex;gap:28px;margin-top:20px;}
.call-btn{width:64px;height:64px;border-radius:50%;border:none;font-size:26px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--shadow);}
.call-hangup{background:#E08A8A;color:#fff;}.call-mute{background:var(--bg-white);color:var(--text-sub);}.call-mute.active{background:var(--warning);}
.call-start-gate{position:absolute;inset:0;background:rgba(245,240,240,.96);display:none;flex-direction:column;align-items:center;justify-content:center;gap:18px;text-align:center;padding:30px;}
.call-start-gate.show{display:flex;}
.call-start-gate p{font-size:13px;color:var(--text-sub);line-height:1.6;max-width:320px;}
.gate-btn{padding:14px 36px;border-radius:30px;border:none;background:var(--accent);color:var(--text-main);font-size:15px;font-weight:600;cursor:pointer;box-shadow:var(--shadow);}
.call-end-toast{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:3600;pointer-events:none;}
.call-end-toast.show{display:flex;}
.call-end-box{background:rgba(79,63,53,.92);color:#fff;padding:18px 30px;border-radius:18px;font-size:15px;line-height:1.6;text-align:center;animation:callEndFade 2s ease forwards;}
@keyframes callEndFade{0%{opacity:0;transform:scale(.9);}15%{opacity:1;transform:scale(1);}80%{opacity:1;}100%{opacity:0;}}
.hidden{display:none!important;}
@media(max-width:600px){
    html{font-size:clamp(13px,4vw,15px);}
    .chat-app{margin:0;height:100dvh;max-height:100dvh;border-radius:0;max-width:100%;}
    .chat-header{padding:8px 10px;padding-top:calc(8px + env(safe-area-inset-top));gap:4px;}
    .brand-avatar{width:36px;height:36px;}
    .brand-avatar>img{width:36px;height:36px;}
    .icon-btn{width:34px;height:34px;font-size:15px;}
    .emotion-pill{font-size:10px;padding:3px 6px;}
    .chat-messages{padding:12px 10px;gap:12px;}
    .message{gap:6px;max-width:82%;}
    .avatar{width:30px;height:30px;}
    .avatar-emoji{font-size:16px;}
    .bubble{padding:9px 13px;border-radius:16px;font-size:var(--chat-font-size);}
    .user-message .bubble{border-bottom-right-radius:4px;}
    .ai-message .bubble{border-bottom-left-radius:4px;}
    .msg-time{font-size:9px;margin-top:3px;}
    .image-bubble img{max-width:62vw;}
    .settings-container{flex-direction:column;width:100%;height:100dvh;max-height:100dvh;border-radius:0;}
    .settings-sidebar{width:100%;height:auto;max-height:100px;border-right:none;border-bottom:1px solid var(--border);}
    .sidebar-list{display:flex;overflow-x:auto;padding:6px;gap:4px;}
    .sidebar-item{flex-shrink:0;}
    .sidebar-item-del{opacity:1;}
    .msg-actions{display:none;}
}
/* 修复：手机/PWA 底部用户情绪不再隐藏，改为紧凑显示 */
@media(max-width:380px){
    .header-controls{gap:3px;}
    .icon-btn{width:32px;height:32px;font-size:14px;}
    .input-emotion{padding:2px 5px;font-size:11px;}
}
