/* =========================================================
   Zovon 风格布局覆盖层
   仅调整 plugin/gpt/app/view/index/index.html 的样式，不改动业务逻辑
   ========================================================= */

/* ---------- 基础覆盖 ---------- */
.left-bar,
.chat-bar {
    /*display: none !important;*/
}

.history-item {
    -webkit-touch-callout: none;
    user-select: none;
    touch-action: pan-y;
}

.ai-container,
.main-container {
    background: var(--ai-body-bg, #ffffff);
}

#app {
    align-items: stretch;
}

/* Keep caret browsing from drawing an insertion cursor in normal UI text. */
body {
    caret-color: transparent;
}

input,
textarea,
[contenteditable="true"],
[contenteditable="plaintext-only"] {
    caret-color: auto;
}

.ai-container {
    height: 100vh;
    min-height: 0;
}

.chat-box {
    width: auto !important;
    flex: 1;
    min-width: 0;
    background: #f7f7f8 !important;
    display: flex;
    flex-direction: column;
}

.chat-box > .body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* ---------- 社交聊天页 ---------- */
.social-friend-bar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.social-friend-search {
    height: 94px;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 14px;
    font-weight: 500;
    position: relative;
}
.social-friend-heading { height: 32px; display: flex; align-items: center; justify-content: space-between; }
.social-friend-query { height: 34px; width: 100%; display: flex; align-items: center; gap: 7px; padding: 0 9px; background: rgba(0,0,0,.045); border-radius: 6px; color: #9ca3af; }
.social-friend-query i { font-size: 13px; }
.social-friend-query input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; padding: 0; background: transparent; color: inherit; font-size: 13px; }
.social-friend-query input::placeholder { color: #9ca3af; }
.social-friend-query button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: #9ca3af; cursor: pointer; }
.social-friend-query button:hover { color: #6b7280; }

.social-friend-list { flex: 1; min-height: 0; height: auto; overflow-y: auto; padding-bottom: 1rem; }
.social-notification-trigger { position: relative; border: 0; background: transparent; color: #6b7280; width: 32px; height: 32px; padding: 0; cursor: pointer; font-size: 18px; }
.social-notification-trigger:hover { background: rgba(0,0,0,.05); border-radius: 50%; }
.social-notification-trigger b, .social-unread-badge { position: absolute; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 10px; line-height: 17px; text-align: center; font-weight: 500; }
.social-notification-trigger b { right: -2px; top: -2px; }
.social-notification-modal { position: fixed; z-index: 2000; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .32); }
.social-notification-dialog { width: min(390px, 100%); max-height: min(460px, calc(100vh - 40px)); overflow-y: auto; background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 8px; box-shadow: 0 18px 42px rgba(0,0,0,.2); padding: 10px; }
.social-notification-title { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; color: #374151; font-size: 14px; font-weight: 600; }
.social-notification-close { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: #6b7280; font-size: 14px; cursor: pointer; }
.social-notification-close:hover { background: rgba(0,0,0,.05); border-radius: 50%; }
.social-location-modal { position: fixed; z-index: 2001; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.32); }
.social-location-dialog { width: min(330px, 100%); padding: 24px; background: #fff; border-radius: 8px; box-shadow: 0 18px 42px rgba(0,0,0,.2); text-align: center; }
.social-location-dialog > .bi { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(37,99,235,.1); color: #2563eb; font-size: 20px; }
.social-location-dialog p { margin: 14px 0 20px; color: #4b5563; font-size: 14px; line-height: 1.6; }
.social-location-actions { display: flex; justify-content: flex-end; gap: 8px; }
.social-location-actions button { border: 0; border-radius: 5px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.social-location-later { background: transparent; color: #6b7280; }
.social-location-enable { background: #2563eb; color: #fff; }
.social-location-enable:disabled { opacity: .65; cursor: default; }
.social-notification-empty { padding: 20px 8px; color: #9ca3af; font-size: 12px; text-align: center; }
.social-notice { display: flex; align-items: center; gap: 7px; padding: 8px; border-bottom: 1px solid rgba(0,0,0,.05); font-size: 12px; color: #6b7280; }
.social-notice.is-unread { background: rgba(37, 99, 235, .05); }
.social-notice .avatar { width: 28px; height: 28px; object-fit: cover; border-radius: 50%; }
.social-notice span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-notice button { border: 0; background: transparent; color: #2563eb; padding: 2px; font-size: 12px; cursor: pointer; }
.social-notice-status { flex: 0 0 auto !important; color: #9ca3af; font-size: 12px; }
.social-notification-pagination { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 12px 4px 3px; }
.social-notification-pagination button { min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: 5px; background: transparent; color: #6b7280; font-size: 12px; cursor: pointer; }
.social-notification-pagination button:hover:not(:disabled), .social-notification-pagination button.active { background: rgba(37, 99, 235, .12); color: #2563eb; }
.social-notification-pagination button:disabled { color: #d1d5db; cursor: default; }
.social-friend-item { display: flex; gap: 10px; align-items: center; padding: .6rem .8rem; border-radius: 0; cursor: pointer; -webkit-user-select: none; user-select: none; caret-color: transparent; }
.social-friend-item * { -webkit-user-select: none; user-select: none; caret-color: transparent; }
.social-friend-item:hover, .social-friend-item.selected-bg { background: var(--ai-selected-bg); }
.social-friend-item .avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.social-friend-avatar-wrap { position: relative; width: 42px; height: 42px; flex-shrink: 0; }
.social-friend-avatar-wrap .avatar { display: block; }
.social-unread-badge { right: -7px; top: -5px; }
.social-friend-copy { min-width: 0; flex: 1; }
.social-friend-copy .name { font-size: 14px; color: #374151; }
.social-friend-copy .text-secondary-sm { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.social-friend-distance { color: #2563eb; font-size: 11px; margin-top: 2px; }
.social-empty-side { color: #9ca3af; font-size: 12px; line-height: 1.7; padding: 22px 12px; text-align: center; }

.social-view-tabs { display: inline-flex; align-items: center; gap: 4px; }
.social-view-tabs button { height: 30px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: #6b7280; font-size: 14px; cursor: pointer; }
.social-view-tabs button:hover { background: rgba(0, 0, 0, .05); color: #374151; }
.social-view-tabs button.active { background: var(--ai-selected-bg); color: var(--bs-primary, #2563eb); font-weight: 600; }
.social-view-tabs-mobile { display: none; min-height: 44px; flex-shrink: 0; justify-content: center; padding: 7px 12px; background: var(--ai-body-bg, #fff); border-bottom: 1px solid rgba(0, 0, 0, .06); }

.social-chat-box .social-body { padding: 26px 24px; overflow-y: auto; }
.social-stream-list, .social-message-list, .social-post-list { width: 100%; max-width: none; margin: 0; }
.social-stream-item { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0; animation: social-reveal .24s ease-out; }
.social-avatar { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.social-result-bubble, .social-message-bubble { max-width: min(70%, 680px); background: #fff; color: #1f2937; border-radius: 7px; padding: 11px 13px; line-height: 1.6; font-size: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.social-result-content { display: inline; }
.social-result-meta { display: inline; margin-left: 2px; color: #8aa0b8; font-size: 11px; line-height: inherit; white-space: nowrap; }
.social-follow { border: 0; padding: 0; margin: 0; background: transparent; color: #2563eb; font-size: 11px; cursor: pointer; white-space: nowrap; }
.social-distance-inline { color: #8aa0b8; font-size: 12px; }
.social-friend-label { color: #6b7280; font-size: 12px; margin-left: 10px; }
.social-search-caption { text-align: center; color: #9ca3af; font-size: 13px; margin: 8px 0 30px; }
.social-interaction-loading { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; color: #9ca3af; font-size: 12px; }
.social-interaction-loading i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: social-loading-dot 1.2s ease-in-out infinite; }
.social-interaction-loading i:nth-of-type(2) { animation-delay: .15s; }
.social-interaction-loading i:nth-of-type(3) { animation-delay: .3s; }
.social-empty { height: 100%; min-height: 260px; display: flex; justify-content: center; align-items: center; color: #9ca3af; font-size: 14px; text-align: center; }
.social-load-more { display: block; margin: 2px auto 16px; padding: 4px 10px; border: 0; background: transparent; color: #6b7280; font-size: 12px; cursor: pointer; }
.social-load-more:hover:not(:disabled) { color: #2563eb; }
.social-load-more:disabled { color: #9ca3af; cursor: default; }
.social-message-row { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0; }
.social-message-row.mine { justify-content: flex-end; }
.social-message-row.mine .social-message-bubble { background: #fff; }
.social-post-bubble small { display: block; margin-top: 6px; color: #9ca3af; font-size: 11px; }
.social-message-time { display: block; margin-top: 6px; color: #9ca3af; font-size: 11px; line-height: 1.4; }
.social-media-list { display: grid; gap: 8px; margin-top: 8px; }
.social-media-list img, .social-media-list video { display: block; max-width: min(100%, 420px); max-height: 320px; border-radius: 6px; object-fit: contain; }
.social-media-list audio { width: min(100%, 320px); }
.social-media-draft { display: flex; flex-wrap: wrap; gap: 8px; max-width: 920px; margin: 0 auto 8px; }
.social-media-draft-item { display: flex; align-items: center; gap: 6px; max-width: 190px; padding: 5px 7px; border: 1px solid rgba(0,0,0,.08); border-radius: 6px; background: #fff; font-size: 12px; color: #4b5563; }
.social-media-draft-item img { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; }
.social-media-draft-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-media-draft-item button, .social-media-action { border: 0; background: transparent; color: #6b7280; cursor: pointer; }
.social-media-draft-item button { padding: 0; margin-left: auto; }
.social-media-action { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; font-size: 16px; line-height: 1; }
.social-media-action .bi::before { display: block; line-height: 1; transform: translateY(1px); }
.social-media-uploading { display: flex; align-items: center; gap: 6px; max-width: 920px; margin: 0 auto 8px; color: #6b7280; font-size: 12px; }
.social-upload-spin { display: inline-block; animation: social-upload-spin .8s linear infinite; }
.social-media-action:hover:not(:disabled) { color: #2563eb; }
.social-media-action:disabled { color: #d1d5db; cursor: default; }
.social-media-action.is-active { color: #4b5563; background: rgba(107, 114, 128, .16); border-radius: 50%; }
.social-voice-panel { max-width: 920px; min-height: 124px; margin: 10px auto 0; padding: 10px 0 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; }
.social-hold-to-talk { width: 60px; height: 60px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: var(--bs-primary, #0d6efd); color: #fff; font-size: 27px; line-height: 1; box-shadow: 0 6px 16px rgba(13, 110, 253, .24); touch-action: none; user-select: none; -webkit-user-select: none; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.social-hold-to-talk:hover:not(:disabled), .social-hold-to-talk:focus-visible:not(:disabled) { background: #0b5ed7; box-shadow: 0 8px 18px rgba(13, 110, 253, .32); outline: none; }
.social-hold-to-talk:active:not(:disabled), .social-hold-to-talk.is-pressing { background: #3c9aff; transform: scale(.94); box-shadow: 0 3px 10px rgba(13, 110, 253, .22); }
.social-hold-to-talk:disabled { background: #9ca3af; box-shadow: none; cursor: default; }
.social-hold-to-talk.is-pressing:disabled { background: #3c9aff; box-shadow: 0 3px 10px rgba(13, 110, 253, .22); }
.social-hold-to-talk-hint { color: #6b7280; font-size: 13px; line-height: 1.4; }
.ai-voice-panel { margin: 0; }
.ai-voice-panel .social-hold-to-talk.is-cancel { background: #dc3545; box-shadow: 0 3px 10px rgba(220, 53, 69, .24); }
.social-recording-overlay { position: fixed; inset: 0; z-index: 2100; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(24px, env(safe-area-inset-top)) 20px max(26px, env(safe-area-inset-bottom)); background: rgba(0, 0, 0, .58); color: #fff; touch-action: none; }
.social-recording-center { width: min(236px, calc(100vw - 64px)); min-height: 184px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 22px 18px; border-radius: 12px; background: #2563eb; box-shadow: 0 18px 48px rgba(37, 99, 235, .3); box-sizing: border-box; }
.social-recording-time { font-size: 15px; font-variant-numeric: tabular-nums; }
.social-recording-center span { font-size: 13px; }
.social-recording-wave { min-width: 0; width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 3px; overflow: hidden; }
.social-recording-wave i { width: 3px; height: 8px; flex: 0 0 3px; border-radius: 2px; background: rgba(255, 255, 255, .95); animation: social-recording-wave .85s ease-in-out infinite alternate; animation-delay: calc(var(--wave-index) * -0.06s); }
.social-recording-wave i:nth-child(3n) { height: 15px; }
.social-recording-wave i:nth-child(4n) { height: 20px; }
.social-recording-wave i:nth-child(5n) { height: 12px; }
.social-recording-bottom { position: absolute; left: 20px; right: 20px; bottom: max(30px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 13px; }
.social-recording-gesture-actions { width: min(360px, 100%); display: flex; align-items: center; justify-content: space-between; }
.social-recording-bottom strong { font-size: 18px; font-weight: 500; }
.social-recording-gesture { width: 108px; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 8px; color: rgba(255, 255, 255, .76); font-size: 12px; transition: background .15s ease, color .15s ease, transform .15s ease; }
.social-recording-gesture i { font-size: 19px; }
.social-recording-cancel.is-active { color: #fff; background: #ef4444; transform: scale(1.06); }
.social-recording-transcribe.is-active { color: #fff; background: #2786e8; transform: scale(1.06); }
@media (min-width: 769px) { .social-recording-gesture { width: 142px; height: 68px; font-size: 13px; } .social-recording-gesture-actions { width: min(440px, 100%); } }
.social-transcribing-overlay { position: fixed; inset: 0; z-index: 2101; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, .58); color: #fff; }
.social-transcribing-card { width: min(270px, 100%); min-height: 168px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 24px; border-radius: 12px; background: #2563eb; box-shadow: 0 18px 48px rgba(37, 99, 235, .3); text-align: center; box-sizing: border-box; }
.social-transcribing-card i { font-size: 44px; animation: social-transcribing-pulse 1s ease-in-out infinite alternate; }
.social-transcribing-card strong { font-size: 16px; font-weight: 500; }
.social-transcribing-card span { color: rgba(255,255,255,.76); font-size: 12px; }
@keyframes social-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes social-loading-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes social-upload-spin { to { transform: rotate(360deg); } }
@keyframes social-recording-wave { from { transform: scaleY(.45); opacity: .6; } to { transform: scaleY(1); opacity: 1; } }
@keyframes social-transcribing-pulse { from { transform: scale(.86); opacity: .68; } to { transform: scale(1.06); opacity: 1; } }

[data-bs-theme="dark"] .social-friend-search { border-bottom-color: rgba(255,255,255,.06); }
[data-bs-theme="dark"] .social-friend-query { background: rgba(255,255,255,.07); color: #e5e7eb; }
[data-bs-theme="dark"] .social-friend-query input::placeholder, [data-bs-theme="dark"] .social-friend-query button { color: #9ca3af; }
[data-bs-theme="dark"] .social-notification-trigger { color: #9ca3af; }
[data-bs-theme="dark"] .social-notification-trigger:hover { background: rgba(255,255,255,.06); }
[data-bs-theme="dark"] .social-notification-modal { background: rgba(0,0,0,.56); }
[data-bs-theme="dark"] .social-notification-dialog { background: #2d2d2d; border-color: rgba(255,255,255,.08); box-shadow: 0 18px 42px rgba(0,0,0,.45); }
[data-bs-theme="dark"] .social-notification-title { color: #f3f4f6; }
[data-bs-theme="dark"] .social-notification-close { color: #9ca3af; }
[data-bs-theme="dark"] .social-notification-close:hover { background: rgba(255,255,255,.06); }
[data-bs-theme="dark"] .social-friend-copy .name { color: #e5e7eb; }
[data-bs-theme="dark"] .social-notice { border-bottom-color: rgba(255,255,255,.06); color: #9ca3af; }
[data-bs-theme="dark"] .social-notification-pagination button { color: #9ca3af; }
[data-bs-theme="dark"] .social-notification-pagination button:hover:not(:disabled), [data-bs-theme="dark"] .social-notification-pagination button.active { background: rgba(59,130,246,.2); color: #93c5fd; }
[data-bs-theme="dark"] .social-notification-pagination button:disabled { color: #4b5563; }
[data-bs-theme="dark"] .social-view-tabs button { color: #9ca3af; }
[data-bs-theme="dark"] .social-view-tabs button:hover { background: rgba(255,255,255,.06); color: #e5e7eb; }
[data-bs-theme="dark"] .social-view-tabs-mobile { background: #202123; border-bottom-color: rgba(255,255,255,.06); }
[data-bs-theme="dark"] .social-result-bubble, [data-bs-theme="dark"] .social-message-bubble, [data-bs-theme="dark"] .social-message-row.mine .social-message-bubble { background: #343536; color: #f3f4f6; }
[data-bs-theme="dark"] .social-media-draft-item { background: #343536; border-color: rgba(255,255,255,.08); color: #d1d5db; }
[data-bs-theme="dark"] .social-media-draft-item button, [data-bs-theme="dark"] .social-media-action { color: #9ca3af; }
[data-bs-theme="dark"] .social-media-action.is-active { color: #e5e7eb; background: rgba(255, 255, 255, .14); }
[data-bs-theme="dark"] .social-hold-to-talk { background: #343536; color: #f3f4f6; }
[data-bs-theme="dark"] .social-hold-to-talk:active:not(:disabled) { background: #444647; }

@media (max-width: 768px) {
    .social-friend-bar { position: fixed; inset: calc(98px + env(safe-area-inset-top)) 0 0; width: 100%; height: auto; z-index: 1022; }
    .social-friend-list { flex: 1; min-height: 0; }
    .social-view-tabs { display: none; }
    .social-view-tabs-mobile { display: flex; }
    .social-chat-box .social-body { padding: 16px 12px calc(84px + env(safe-area-inset-bottom)); }
    .social-chat-box.is-recording .social-body { padding-bottom: 230px; }
    .social-chat-box.has-voice-panel .social-body { padding-bottom: calc(166px + env(safe-area-inset-bottom)); }
    .social-stream-list, .social-message-list, .social-post-list { width: 100%; }
    .social-stream-item, .social-message-row { gap: 8px; margin: 14px 0; }
    .social-avatar { width: 36px; height: 36px; }
    .social-result-bubble, .social-message-bubble { max-width: calc(100% - 44px); padding: 9px 11px; overflow-wrap: anywhere; }
    .social-media-list img, .social-media-list video { width: 100%; max-width: 100%; max-height: 280px; }
    .social-media-list audio { width: 100%; }
    .social-chat-box .footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1021; }
    .social-chat-box .footer > div:not(.chat-input-bar) { max-width: 100%; }
    .social-media-draft { max-height: 76px; overflow-y: auto; padding: 0 2px; }
    .social-media-draft-item { max-width: min(190px, calc(100vw - 28px)); }
    .social-media-uploading { padding: 0 2px; }
    .social-voice-panel { min-height: 116px; margin-top: 8px; padding: 8px 2px 0; }
    .social-recording-center { width: min(224px, calc(100vw - 48px)); min-height: 172px; }
}

[data-bs-theme="dark"] .chat-box {
    background: #2d2d2d !important;
}

/* ---------- 侧边栏 ---------- */
.zovon-sidebar {
    width: 260px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1040;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 桌面端收起侧边栏（窄图标模式） */
.zovon-sidebar.collapsed {
    width: 60px;
    overflow: hidden;
}

.zovon-sidebar.collapsed .sidebar-scroll {
    padding: 14px 6px 0;
}

.zovon-sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 6px 0 18px;
}

.zovon-sidebar.collapsed .brand-text,
.zovon-sidebar.collapsed .menu-item > span:not(.d-flex),
.zovon-sidebar.collapsed .history-section,
.zovon-sidebar.collapsed .history-header,
.zovon-sidebar.collapsed .history-title,
.zovon-sidebar.collapsed .user-info > span {
    display: none !important;
}

.zovon-sidebar.collapsed .history-section {
    display: none !important;
}

.zovon-sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 9px 6px;
}

.zovon-sidebar.collapsed .history-item {
    justify-content: center;
    padding: 8px 6px;
}

.zovon-sidebar.collapsed .user-info {
    justify-content: center;
}

.zovon-sidebar.collapsed .sidebar-footer {
    padding: 12px 6px;
}

.zovon-sidebar.no-transition {
    transition: none !important;
}

[data-bs-theme="dark"] .zovon-sidebar {
    background: #202123;
    border-right-color: rgba(255, 255, 255, 0.06);
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 0;
}

/* Logo */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px 18px;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
}

[data-bs-theme="dark"] .sidebar-brand {
    color: #f9fafb;
}

.brand-logo,
.mobile-logo-icon {
    width: 30px;
    height: 30px;
    border-radius:3px;
    flex-shrink: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

/* 新对话按钮 */
.new-chat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.18s ease;
    user-select: none;
}

.new-chat:hover {
    background: #ededf0;
    border-color: rgba(0, 0, 0, 0.1);
}

.new-chat .shortcut {
    margin-left: auto;
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 5px;
    font-weight: 400;
}

[data-bs-theme="dark"] .new-chat {
    background: #2d2d2d;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

[data-bs-theme="dark"] .new-chat:hover {
    background: #3d3d3d;
}

[data-bs-theme="dark"] .new-chat .shortcut {
    background: #3d3d3d;
    color: #9ca3af;
}

/* 菜单 */
.sidebar-menu {
    margin-bottom: 18px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: #4b5563;
    font-size: 14px;
    margin-bottom: 3px;
    transition: background 0.15s ease;
    user-select: none;
}

.menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.menu-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

[data-bs-theme="dark"] .menu-item {
    color: #d1d5db;
}

[data-bs-theme="dark"] .menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .menu-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.menu-item i,
.menu-item .iconfont,
.menu-item .d-flex {
    font-size: 24px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    font-style: normal;
}

/* 历史对话 */
.history-section {
    margin-bottom: 10px;
}

.history-header {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 6px;
    padding-left: 6px;
    font-weight: 500;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    color: #4b5563;
    font-size: 13px;
    transition: background 0.15s ease;
    user-select: none;
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.history-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.history-item.pinned .history-title {
    font-weight: 500;
}

[data-bs-theme="dark"] .history-item {
    color: #d1d5db;
}

[data-bs-theme="dark"] .history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .history-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.history-item i {
    font-size: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* 收起侧边栏时使用首字母作为历史对话标识 */
.history-item .history-initial {
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    font-style: normal;
}

[data-bs-theme="dark"] .history-item .history-initial {
    background: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

.history-item.active .history-initial {
    background: #2563eb;
    color: #ffffff;
}

.history-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    background: #ffffff;
}

[data-bs-theme="dark"] .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
    background: #202123;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    width: 100%;
}

.user-info:hover {
    color: #111827;
}

[data-bs-theme="dark"] .user-info {
    color: #e5e7eb;
}

[data-bs-theme="dark"] .user-info:hover {
    color: #f9fafb;
}

.user-info .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 移动端顶部栏 ---------- */
.mobile-header {
    height: calc(54px + env(safe-area-inset-top));
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top) 14px 0;
    background: var(--ai-body-bg, #ffffff);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

[data-bs-theme="dark"] .mobile-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.mobile-header-left,
.mobile-header-right {
    font-size: 22px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 48px;
    min-width: 48px;
    height: 48px;
    position: relative;
    z-index: 1;
}

.mobile-header-right {
    justify-content: flex-end;
}

.mobile-header-right [role="button"] {
    cursor: pointer;
}

.mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    position: absolute;
    left: 50%;
    max-width: calc(100% - 128px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateX(-50%);
}

[data-bs-theme="dark"] .mobile-header-left,
[data-bs-theme="dark"] .mobile-header-right,
[data-bs-theme="dark"] .mobile-logo {
    color: #f9fafb;
}

/* ---------- 聊天区头部 ---------- */
.chat-box-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    background: #f7f7f8;
}

[data-bs-theme="dark"] .chat-box-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    background: #2d2d2d;
}

.header-title {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

[data-bs-theme="dark"] .header-title {
    color: #f9fafb;
}

.header-actions {
    position: absolute;
    top: 0;
    right: 18px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b7280;
    font-size: 20px;
}

.header-actions i,
.header-actions a {
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    transition: background 0.15s ease;
    color: #6b7280;
    text-decoration: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.header-actions i:hover,
.header-actions a:hover {
    background: rgba(0, 0, 0, 0.05);
}

.header-actions i::before,
.header-left-actions i::before {
    vertical-align: 0 !important;
}

.header-left-actions {
    position: absolute;
    top: 0;
    left: 18px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #6b7280;
    font-size: 20px;
}

.header-left-actions i {
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    transition: background 0.15s ease;
    color: #6b7280;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.header-left-actions i:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .header-actions,
[data-bs-theme="dark"] .header-actions i,
[data-bs-theme="dark"] .header-actions a {
    color: #9ca3af;
}

[data-bs-theme="dark"] .header-actions i:hover,
[data-bs-theme="dark"] .header-actions a:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .header-left-actions,
[data-bs-theme="dark"] .header-left-actions i {
    color: #9ca3af;
}

[data-bs-theme="dark"] .header-left-actions i:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ---------- 欢迎页 ---------- */
.welcome-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.chat-box .body.has-dialog-video {
    background: #0b1220;
}

.new-chat-background-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.chat-box .body.has-dialog-video::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(8, 15, 30, .28);
    z-index: 1;
    pointer-events: none;
}

.chat-box .body.has-dialog-video > :not(.new-chat-background-video) {
    position: relative;
    z-index: 2;
}

.chat-box .body.has-dialog-video .welcome-text {
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}

@media (max-width: 768px) {
    .new-chat-background-video {
        position: fixed;
        top: calc(54px + env(safe-area-inset-top));
        right: 0;
        bottom: auto;
        left: 0;
        width: 100vw;
        height: calc(100dvh - 54px - env(safe-area-inset-top));
        object-fit: cover !important;
        object-position: center center;
    }
}

.welcome-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
}

.welcome-logo svg,
.welcome-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 12px;
}

.welcome-text {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.hot-topics { width: min(100%, 620px); margin-top: 34px; text-align: left; }
.hot-topics-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: #4b5563; font-size: 14px; font-weight: 600; }
.hot-topics-heading button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: #64748b; background: transparent; }
.hot-topics-heading button:hover { background: rgba(37, 99, 235, .09); color: #2563eb; }
.hot-topics-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hot-topics-list button { display: flex; align-items: center; min-width: 0; min-height: 50px; padding: 10px 12px; border: 1px solid rgba(148, 163, 184, .32); border-radius: 8px; color: #334155; background: rgba(255, 255, 255, .78); text-align: left; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.hot-topics-list button:hover { border-color: rgba(37, 99, 235, .52); box-shadow: 0 4px 12px rgba(37, 99, 235, .10); transform: translateY(-1px); }
.hot-topics-list b { flex: 0 0 auto; margin-right: 9px; color: #2563eb; font-size: 13px; }
.hot-topics-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.hot-topics-list i { flex: 0 0 auto; margin-left: 7px; color: #94a3b8; font-size: 13px; }
.hot-topics-loading, .hot-topics-error { display: flex; align-items: center; justify-content: center; min-height: 50px; margin: 0; color: #64748b; font-size: 13px; }
.hot-topics-loading i { margin-right: 7px; animation: hot-topic-spin 1s linear infinite; }
.hot-topics-error { color: #94a3b8; }
@keyframes hot-topic-spin { to { transform: rotate(360deg); } }
[data-bs-theme="dark"] .hot-topics-heading { color: #cbd5e1; }
[data-bs-theme="dark"] .hot-topics-list button { color: #e2e8f0; border-color: rgba(148, 163, 184, .25); background: rgba(30, 41, 59, .68); }

[data-bs-theme="dark"] .welcome-text {
    color: #f9fafb;
}

.ai-followup-suggestions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    width: min(100%, 460px);
    margin: 12px 8px 0;
}

.ai-followup-suggestions button {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 34px;
    padding: 7px 11px;
    border: 0;
    border-radius: 8px;
    color: #475569;
    background: rgba(148, 163, 184, .12);
    font-size: 13px;
    line-height: 20px;
    text-align: left;
}

.ai-followup-suggestions button:hover { color: #1d4ed8; background: rgba(37, 99, 235, .10); }
.ai-followup-suggestions span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-followup-suggestions i { flex: 0 0 auto; margin-left: 8px; font-size: 13px; }
[data-bs-theme="dark"] .ai-followup-suggestions button { color: #cbd5e1; background: rgba(148, 163, 184, .14); }

/* ---------- 底部输入栏 ---------- */
.chat-box .footer {
    background: var(--ai-message-list-bg); 
    border-top: none;
    padding: 12px 18px 18px;
}

.chat-input-bar {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    justify-content: space-between;
    height: 50px;
    box-sizing: border-box;
}

[data-bs-theme="dark"] .chat-input-bar {
    background: #2d2d2d;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.input-bar-plus,
.input-actions .iconfont,
.input-actions .bi,
.input-actions .chat-tools-item {
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 2;
    caret-color: transparent;
}

/* Direct toolbar icons need an explicit line box; otherwise their font baseline
   makes the glyph appear lower than the centered hover background. */
.input-actions > .bi,
.input-actions > .iconfont,
.input-actions > .chat-tools-item {
    display: inline-grid;
    place-items: center;
    line-height: 1;
}

.input-actions > .bi::before,
.input-actions > .iconfont::before {
    display: block;
    line-height: 1;
    transform: translateY(1px);
}

.input-bar-plus:hover,
.input-actions .iconfont:hover,
.input-actions .bi:hover,
.input-actions .chat-tools-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.input-actions .bi.selected,
.input-actions .iconfont.selected,
.input-actions .chat-tools-item.selected,
.input-actions .bi.active,
.input-actions .iconfont.active,
.input-actions .chat-tools-item.active {
    color: var(--bs-primary);
}

[data-bs-theme="dark"] .input-bar-plus,
[data-bs-theme="dark"] .input-actions .iconfont,
[data-bs-theme="dark"] .input-actions .bi,
[data-bs-theme="dark"] .input-actions .chat-tools-item {
    color: #9ca3af;
}

[data-bs-theme="dark"] .input-bar-plus:hover,
[data-bs-theme="dark"] .input-actions .iconfont:hover,
[data-bs-theme="dark"] .input-actions .bi:hover,
[data-bs-theme="dark"] .input-actions .chat-tools-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-box .footer .chat-input-bar .input,
.chat-input-bar .input {
    flex: 1;
    min-width: 0;
    width: auto;
    box-sizing: border-box;
    display: block;
    margin: 0;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 15px;
    line-height: 30px;
    padding: 0 10px 0 0;
    color: #111827;
    min-height: 24px;
    max-height: 160px;
    overflow: hidden;
}

.social-chat-box .chat-input-bar { height: auto; min-height: 50px; align-items: center; }
.social-chat-box .chat-input-bar .social-auto-input { height: 30px; min-height: 30px; padding: 0 4px; line-height: 30px; }

.chat-input-bar .input::placeholder {
    color: #9ca3af;
}

[data-bs-theme="dark"] .chat-box .footer .chat-input-bar .input,
[data-bs-theme="dark"] .chat-input-bar .input {
    color: #f9fafb;
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    z-index: 1;
    background: inherit;
    padding-left: 6px;
    border-radius: 28px;
    pointer-events: auto;
}

/* Voice mode keeps the text field available; retain the normal toolbar flow. */
.chat-box .chat-input-bar.voice-mode .input-actions { margin-left: 0; }

.input-actions > .send-btn {
    position: static;
    right: auto;
    bottom: auto;
    width: 32px !important;
    height: 32px !important;
    padding: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent !important;
    color: #6b7280 !important;
    box-shadow: none !important;
}

.input-actions > .send-btn > .bi-send {
    display: block !important;
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
    color: inherit;
    background: transparent !important;
    line-height: 1;
    position: static;
    z-index: auto;
    border-radius: 0;
    cursor: inherit;
    transition: none;
}

.input-actions button {
    margin: 0;
    border: 0;
    background: transparent;
}
i{
    font-style:normal;
}
.chat-box .send-btn:hover,
.chat-box .send-btn.active {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #6b7280 !important;
}

.input-actions > .send-btn > .bi-send::before {
    display: block;
    color: #6b7280 !important;
    font-size: 18px;
    line-height: 1;
    transform: translateY(1px);
}

/* ---------- 弹窗定位（参数、历史话题） ---------- */
.params-box {
    position: absolute;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90% !important;
    max-width: 600px;
    background-color: var(--bs-body-bg);
    padding: 1rem;
    border-radius: var(--bs-border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 10001;
}

.history-box {
    position: absolute;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    bottom: 110px;
    background-color: var(--bs-body-bg);
    padding: 1rem;
    border-radius: var(--bs-border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 10001;
}

/* ---------- 模块 iframe 容器 ---------- */
.page-box {
    flex: 1;
    width: auto !important;
    min-width: 0;
    background: var(--ai-body-bg, #ffffff);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .zovon-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .zovon-sidebar.show {
        transform: translateX(0);
    }

    .zovon-sidebar.collapsed {
        margin-left: 0;
    }

    .zovon-sidebar.no-transition {
        transition: none !important;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1035;
    }

    .chat-box {
        padding-top: calc(54px + env(safe-area-inset-top));
    }

    .chat-box-header {
        display: none;
    }

    .chat-box .footer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
        background: var(--ai-body-bg, #ffffff);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        z-index: 1020;
    }

    .chat-box .footer.ai-voice-active {
        height: calc(196px + env(safe-area-inset-bottom));
        box-sizing: border-box;
        overflow: visible;
    }
    .chat-box .footer.ai-voice-active .ai-voice-panel {
        position: relative;
        width: 100%;
        height: 116px;
        min-height: 116px;
        max-height: 116px;
        z-index: 2;
        margin-top: 16px;
    }
    .chat-box .footer.ai-voice-active .ai-voice-stage {
        position: absolute;
        top: 58px;
        left: 0;
        right: 0;
        height: 132px;
        flex: 0 0 132px;
        z-index: 2;
    }
    .chat-box.ai-voice-active .body { padding-bottom: calc(198px + env(safe-area-inset-bottom)); }

    [data-bs-theme="dark"] .chat-box .footer {
        border-top-color: rgba(255, 255, 255, 0.05);
    }

    .chat-input-bar {
        border-radius: 24px;
        padding: 4px 8px;
        gap: 4px;
        position: relative;
        align-items: center;
    }

    .chat-input-bar .input {
        font-size: 16px;
        padding: 8px 44px 8px 4px;
        min-height: 20px;
        line-height: 1.4;
    }

    .chat-input-bar .input::placeholder {
        color: #9ca3af;
    }

    .chat-input-bar .input-bar-plus,
    .chat-input-bar .input-actions .bi {
        font-size: 22px;
        width: 36px;
        height: 36px;
    }

    .chat-input-bar .input-actions > .send-btn > .bi-send {
        width: 18px;
        height: 18px;
        font-size: 18px;
    }

    /* 移动端用 inline-flex 覆盖桌面端的 32x32 设置 */
    .chat-input-bar .input-bar-plus {
        padding: 0;
    }

    .chat-input-bar .input-actions {
        position: absolute;
        right: 25px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        gap: 0;
    }

    .chat-input-bar .input-actions .mic-btn,
    .chat-input-bar .input-actions .send-btn {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        position: static;
    }

    /* AI chat can show voice and send controls together on mobile. Give each
       control its own slot rather than constraining both to the single-action area. */
    .chat-input-bar .ai-chat-input { padding-right: 84px; }
    .chat-input-bar .ai-input-actions { right: 12px; width: auto; gap: 4px; justify-content: flex-end; }
    .chat-input-bar .ai-input-actions > .chat-tools-item,
    .chat-input-bar .ai-input-actions > .send-btn { width: 36px !important; height: 36px !important; flex: 0 0 36px; }

    /* Social messages can expose several media actions, so they must not share
       the compact, single-action positioning used by the standard chat bar. */
    .social-chat-box .chat-input-bar .input {
        height: auto;
        min-height: 42px;
        padding: 9px 4px !important;
        line-height: 24px;
        max-height: 120px;
        overflow-y: hidden;
    }

    .social-chat-box .chat-input-bar .input-actions {
        position: static;
        width: auto;
        height: auto;
        flex: 0 0 auto;
        gap: 4px;
        transform: none;
    }

    .social-chat-box .chat-input-bar .input-actions .social-media-action,
    .social-chat-box .chat-input-bar .input-actions .send-btn {
        width: 32px;
        height: 32px;
    }

    .message-list .message {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .message-toolbar {
        display: none !important;
    }

    .welcome-logo {
        width: 64px;
        height: 64px;
    }

    .welcome-text {
        font-size: 20px;
    }

    .hot-topics { margin-top: 26px; }
    .hot-topics-list { grid-template-columns: 1fr; gap: 8px; }
    .ai-followup-suggestions { width: calc(100% - 16px); }

    .params-box {
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        width: auto !important;
        bottom: 12px !important;
        transform: none !important;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }

    .chat-box .send-btn {
        right: 14px;
        bottom: 16px;
    }
}

@media (max-width: 576px) {
    .zovon-sidebar {
        width: 80%;
        max-width: 300px;
    }
}

@media (max-width: 375px) {
    .social-chat-box .footer { padding-left: 8px; padding-right: 8px; }
    .social-chat-box .chat-input-bar { gap: 2px; padding-left: 6px; padding-right: 6px; }
    .social-chat-box .chat-input-bar .input-actions { gap: 2px; padding-left: 2px; }
    .social-chat-box .chat-input-bar .input-actions .social-media-action,
    .social-chat-box .chat-input-bar .input-actions .send-btn { width: 30px; height: 30px; }
}

/* ---------- 兼容小窗口模式（界面缩小为浮动窗口） ---------- */
body.small-window-body,
.small-window-mode body {
    background: #e5e7eb !important;
}

[data-bs-theme="dark"].small-window-body,
.small-window-mode [data-bs-theme="dark"] {
    background: #111827 !important;
}

.small-window {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: min(94vw, 1100px) !important;
    height: min(92vh, 720px) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.1) !important;
    background: var(--ai-body-bg, #ffffff) !important;
    z-index: 1030 !important;
}

[data-bs-theme="dark"] .small-window {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.3) !important;
}

/* 窗口模式下侧边栏保持显示，但宽度收窄 */
.small-window .zovon-sidebar {
    display: flex !important;
    width: 220px;
}

.small-window .chat-box {
    padding-top: 0 !important;
}

.small-window .chat-box-header {
    display: flex !important;
}

.small-window .chat-box .footer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    border-top: none;
}

/* 窗口模式下隐藏退出浮动按钮（header 中已有退出按钮） */
.small-window-exit {
    display: none !important;
}

/* ---------- 隐藏原 header（已经被 chat-box-header 替代） ---------- */
.chat-box > .header {
    display: none !important;
}

/* ---------- 历史右侧面板适配 ---------- */
.right-box {
    z-index: 1050;
}

/* ---------- 系统菜单定位（右上角按钮下方） ---------- */
.more-box {
    position: fixed !important;
    top: 60px !important;
    right: 18px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 1075 !important;
}

/* 窗口模式下需要考虑浮动窗口偏移 */
.small-window .more-box {
    top: 50% !important;
    right: auto !important;
    left: calc(50% + min(94vw, 1100px) / 2 - 218px) !important;
    transform: translateY(-50%) !important;
}

@media (max-width: 768px) {
    /* 移动端 more-box 定位由 app.css 控制（从底部弹出全宽） */
    .more-box {
        top: auto !important;
        right: 0 !important;
        left: 0 !important;
        bottom: calc(3.2rem + env(safe-area-inset-bottom)) !important;
        width: 100% !important;
        border-radius: 12px 12px 0 0 !important;
    }
}

/* ---------- 移动端更多操作菜单 ---------- */
.mobile-actions-box {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background-color: var(--bs-body-bg);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    padding: 8px 0;
}

.mobile-actions-box .dropdown-item {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: var(--bs-body-color);
}

.mobile-actions-box .dropdown-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ---------- 参数面板定位修正 ---------- */
@media (min-width: 769px) {
    .params-box {
        /*left: 280px !important;*/
        z-index: 1065 !important;
    }
}

/* ---------- 阴影层提高层级 ---------- */
.overlay {
    z-index: 1060;
}

.center-box,
.more-box,
.center-div {
    z-index: 1070 !important;
}

.img-preview {
    z-index: 1080;
}

/* ---------- 修复后端菜单 icon-* 图标不显示 ---------- */
[class^="icon-"],
[class*=" icon-"] {
    font-family: iconfont;
}

/* ---------- 全局禁止图标/可点击元素出现文字选择光标 ---------- */
.iconfont,
.icon,
[class^="icon-"],
[class*=" icon-"],
.menu-item i,
.history-item i,
.input-bar-plus,
.input-actions .bi,
.input-actions .iconfont,
.header-actions i,
.header-actions a,
.header-left-actions i {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    caret-color: transparent;
}

/* 顶部/移动端标题文字禁止选中和出现光标 */
.header-title,
.mobile-logo,
.mobile-logo span,
.sidebar-brand,
.sidebar-brand .brand-text,
.new-chat span,
.menu-item > span:last-child,
.history-header,
.user-info span,
.history-title {
    -webkit-user-select: none;
    user-select: none;
    caret-color: transparent;
    cursor: default;
}

/* 侧边栏 brand 区域不可选中，但保留可点击时的手型 */
.sidebar-brand {
    cursor: pointer;
}

/* 对确实可点击的菜单/新对话文字恢复手型光标，文字仍不可选中 */
.new-chat span,
.menu-item > span:last-child {
    cursor: inherit;
}
