/* ========================================
   AI客服 - 谈天浮窗组件 v2.0
   - 科技感悬浮按钮（呼吸圈 + 发光光圈）
   - 多皮肤支持
   - 语音输入/播报
   - 移动端适配
   ======================================== */

:root {
    --ss-theme: #165DFF;
    --ss-theme-light: #E8F3FF;
    --ss-theme-dark: #0E42D2;
    --ss-header-bg: linear-gradient(135deg, var(--ss-theme) 0%, var(--ss-theme-dark) 100%);
    --ss-bot-bubble: #FFFFFF;
    --ss-user-bubble: var(--ss-theme);
    --ss-border: #E5E6EB;
    --ss-text-primary: #1D2129;
    --ss-text-secondary: #86909C;
    --ss-quick-bg: #F2F3F5;
    --ss-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --ss-radius: 12px;
}

/* 全局盒模型沉置，确保padding/border不撑宽元素 */
.ss-chat-window,
.ss-chat-window *,
.ss-chat-window *::before,
.ss-chat-window *::after {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

/* 皮肤 */
.ss-chat-window[data-theme="blue"] { --ss-theme: #165DFF; --ss-theme-light: #E8F3FF; --ss-theme-dark: #0E42D2; }
.ss-chat-window[data-theme="orange"] { --ss-theme: #FF7D00; --ss-theme-light: #FFF7E8; --ss-theme-dark: #D25F00; }
.ss-chat-window[data-theme="green"] { --ss-theme: #00884A; --ss-theme-light: #E6F6EE; --ss-theme-dark: #006644; }
.ss-chat-window[data-theme="dark"] { --ss-theme: #4E5969; --ss-theme-light: #F2F3F5; --ss-theme-dark: #272E3B; }
.ss-chat-window[data-theme="purple"] { --ss-theme: #722ED1; --ss-theme-light: #F9F0FF; --ss-theme-dark: #5310B3; }

/* ========== 浮动按钮 - 科技感 ========== */
.ss-chat-btn {
    position: fixed;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    right: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ss-theme);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 发光光圈 */
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.8),
        0 0 0 4px var(--ss-theme),
        0 4px 20px rgba(22, 93, 255, 0.5),
        0 0 30px rgba(22, 93, 255, 0.3);
}

.ss-chat-btn::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid var(--ss-theme);
    animation: ss-ripple 2s ease-out infinite;
    opacity: 0;
}

.ss-chat-btn::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid var(--ss-theme);
    animation: ss-ripple 2s ease-out infinite 1s;
    opacity: 0;
}

@keyframes ss-ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ss-chat-btn:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 1),
        0 0 0 4px var(--ss-theme),
        0 6px 30px rgba(22, 93, 255, 0.6),
        0 0 40px rgba(22, 93, 255, 0.4);
}

.ss-chat-btn:active {
    transform: scale(0.95);
}

.ss-chat-btn.ss-left {
    right: auto;
    left: 28px;
}

/* 地位偏移工具类：避开页面底部固定元素（如返回顶部、客服、征询等按钮）
   使用方式：在初始化配置中传入 position: 'right-bottom-far' 或 'left-bottom' 等 */
.ss-chat-btn.ss-pos-right-far {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}
.ss-chat-btn.ss-pos-left-bottom {
    right: auto;
    left: 28px;
}
.ss-chat-btn.ss-pos-left-far {
    right: auto;
    left: 28px;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

.ss-chat-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
    position: relative;
    z-index: 1;
}

/* ========== 谈天窗口 ========== */
.ss-chat-window {
    position: fixed;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    right: 28px;
    width: 380px;
    height: 560px;
    background: white;
    border-radius: var(--ss-radius);
    box-shadow: var(--ss-shadow);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ss-chat-window.ss-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ss-chat-window.ss-left {
    right: auto;
    left: 28px;
}

/* ========== 头部 ========== */
.ss-chat-header {
    background: var(--ss-header-bg);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
}

.ss-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ss-chat-avatar {
    /* size adjusted for clarity */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.ss-chat-avatar svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* 头部头像呼吸圈 - 在线状态 */
.ss-chat-avatar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%) scale(1);
    animation: ss-header-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes ss-header-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}

.ss-chat-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ss-chat-subtitle {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.85;
}

.ss-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ss-voice-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    opacity: 0.9;
    padding: 4px 8px;
    border-radius: 4px;
}

.ss-voice-toggle:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.ss-voice-toggle svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.ss-voice-toggle input {
    display: none;
}

.ss-voice-toggle-slider {
    width: 28px;
    height: 16px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    position: relative;
    transition: background 0.2s;
}

.ss-voice-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: left 0.2s;
}

.ss-voice-toggle input:checked + .ss-voice-toggle-slider {
    background: rgba(255, 255, 255, 0.55);
}

.ss-voice-toggle input:checked + .ss-voice-toggle-slider::after {
    left: 14px;
}

/* 旧的关关按钮形状已由 .ss-header-btn 统一治理 */
.ss-chat-close::before {
    display: none;
}

.ss-chat-close svg,
.ss-chat-close img {
    display: block;
    object-fit: contain;
}

.ss-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ss-header-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background 0.2s;
}

.ss-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ss-header-btn:active {
    transform: scale(0.92);
}

.ss-header-btn svg {
    width: 16px;
    height: 16px;
    stroke: white;
    fill: none;
    display: block;
}

.ss-chat-close svg,
.ss-chat-close img {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
    object-fit: contain;
}

.ss-chat-close:hover {
    background: rgba(255, 80, 80, 0.8) !important;
}

/* ========== 新闻区域 ========== */
.ss-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #FAFBFC;
    scroll-behavior: smooth;
}

.ss-chat-messages::-webkit-scrollbar { width: 4px; }
.ss-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ss-chat-messages::-webkit-scrollbar-thumb { background: #C9CDD4; border-radius: 2px; }

.ss-welcome {
    text-align: center;
    padding: 24px 16px;
    margin-bottom: 16px;
    background: var(--ss-theme-light);
    border-radius: var(--ss-radius);
}

.ss-welcome-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.ss-welcome h3 {
    margin: 0 0 8px 0;
    color: var(--ss-theme);
    font-size: 18px;
}

.ss-welcome p {
    margin: 0;
    color: var(--ss-text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.ss-message {
    display: flex;
    margin-bottom: 16px;
    align-items: flex-start;
    gap: 10px;
}

.ss-message {
    width: 100%;
}
.ss-message.ss-user {
    justify-content: flex-end;
}

.ss-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ss-bot .ss-message-avatar {
    background: var(--ss-theme);
    color: white;
    padding: 0;
    overflow: hidden;
}
.ss-bot .ss-message-avatar svg,
.ss-bot .ss-message-avatar img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.ss-bot .ss-message-avatar svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.ss-user .ss-message-avatar {
    background: #ffffff;
    border: 1px solid #e4e7ed;
}

.ss-message-content {
    width: 100%;
    max-width: none;
    padding: 10px 14px;
    border-radius: var(--ss-radius);
    line-height: 1.6;
    font-size: 14px;
    word-break: break-word;
    box-sizing: border-box;
}

.ss-bot .ss-message-content {
    background: white;
    color: var(--ss-text-primary);
    border-top-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ss-user .ss-message-content {
    background: var(--ss-theme);
    color: white;
    border-top-right-radius: 4px;
}

.ss-message-content p { margin: 0 0 8px 0; }
.ss-message-content p:last-child { margin-bottom: 0; }
.ss-message-content ul, .ss-message-content ol { margin: 8px 0; padding-left: 20px; }
.ss-message-content li { margin-bottom: 4px; }
.ss-message-content strong { font-weight: 600; }

.ss-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 16px !important;
}

.ss-typing span {
    width: 6px;
    height: 6px;
    background: #C9CDD4;
    border-radius: 50%;
    animation: ss-bounce 1.4s infinite ease-in-out both;
}

.ss-typing span:nth-child(1) { animation-delay: -0.32s; }
.ss-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ss-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ========== 快捷问题 ========== */
.ss-quick-questions {
    display: none !important;

    padding: 10px 16px 8px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 10px;
    background: white;
    border-top: 1px solid var(--ss-border);
    flex-shrink: 0;
    overflow-x: auto;
}

.ss-quick-questions::-webkit-scrollbar {
    display: none;
}

.ss-quick-question-btn {
    flex: 1;
    max-width: 120px;
    padding: 8px 4px;
    background: var(--ss-quick-bg);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    color: var(--ss-text-primary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.ss-quick-question-btn:hover {
    background: var(--ss-theme-light);
    color: var(--ss-theme);
}

/* ========== 输入区域 ========== */
.ss-chat-input-area {
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: 12px 16px 16px;
    background: white;
    border-top: 1px solid #eee;
    gap: 0;
    flex-shrink: 0;
    position: relative;
}

/* 输入框整体容器 - 大圆角矩形 */
.ss-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    background: #F7F8FA;
    border: 1px solid #E5E6EB;
    border-radius: 14px;
    padding: 0 4px;
    min-height: 50px;
    transition: border-color 0.2s, background 0.2s;
    gap: 0;
}

.ss-input-container:focus-within {
    border-color: var(--ss-theme);
    background: #fff;
}

.ss-lead-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    color: var(--ss-text-secondary, #86909C);
    font-size: 18px;
    transition: all 0.2s;
}
.ss-lead-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}
.ss-lead-btn:hover {
    color: var(--ss-theme);
    background: var(--ss-theme-light);
}

.ss-input-wrapper {
    flex: 1;
    position: relative;
    min-width: 0;
    margin: 0 4px;
}

.ss-chat-input {
    width: 100%;
    min-height: 32px;
    max-height: 100px;
    padding: 6px 4px;
    border: none;
    border-radius: 0;
    font-size: 15px;
    resize: none;
    outline: none;
    font-family: inherit;
    background: transparent;
    -webkit-appearance: none;
    line-height: 1.5;
    box-sizing: border-box;
}

.ss-chat-input:focus { border-color: transparent; background: transparent; }

.ss-voice-btn, .ss-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    -webkit-appearance: none;
}

.ss-voice-btn {
    background: transparent;
    color: var(--ss-text-secondary, #86909C);
    position: relative;
    z-index: 10001;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ss-voice-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: none;
}

.ss-voice-btn:hover {
    background: var(--ss-theme-light);
    color: var(--ss-theme);
}

.ss-voice-btn.ss-recording {
    background: #F53F3F;
    color: white;
    animation: ss-pulse 1s infinite;
}

.ss-send-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes ss-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 63, 63, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(245, 63, 63, 0); }
}

.ss-send-btn {
    background: var(--ss-theme);
    color: white;
}

.ss-send-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.ss-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 灌音提醒 */
.ss-recording-tip {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    display: none;
    align-items: center;
    gap: 6px;
    z-index: 10;
    white-space: nowrap;
}

.ss-recording-tip.ss-show { display: flex; }

.ss-recording-tip-dot {
    width: 8px;
    height: 8px;
    background: #F53F3F;
    border-radius: 50%;
    animation: ss-bounce 1s infinite;
}

/* ========== 名片 ========== */
.ss-card {
    background: white;
    border-radius: var(--ss-radius);
    padding: 16px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ss-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ss-border);
}

.ss-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.ss-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ss-text-primary);
    margin: 0 0 4px 0;
}

.ss-card-title {
    font-size: 12px;
    color: var(--ss-text-secondary);
    margin: 0;
}

.ss-card-info {
    font-size: 13px;
    color: var(--ss-text-primary);
    line-height: 1.8;
}

.ss-card-info div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ss-card-info .label {
    color: var(--ss-text-secondary);
    min-width: 48px;
}

.ss-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.ss-card-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.ss-card-btn.primary {
    background: var(--ss-theme);
    color: white;
}

.ss-card-btn.primary:hover { background: var(--ss-theme-dark); }

.ss-card-btn.secondary {
    background: var(--ss-quick-bg);
    color: var(--ss-text-primary);
}

.ss-card-btn.secondary:hover { background: #E5E6EB; }

.ss-wechat-qr {
    width: 100%;
    max-width: 160px;
    display: block;
    margin: 0 auto;
}

/* ========== 媒体图片+视频 ========== */
.ss-media-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ss-media-image-item,
.ss-media-video-item {
    position: relative;
    width: calc((100% - 16px) / 3);
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.ss-media-image-item img,
.ss-media-video-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.ss-media-image-item:hover img,
.ss-media-video-item:hover img { transform: scale(1.05); }

.ss-media-image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: white;
    font-size: 12px;
}

.ss-media-video-item .ss-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.ss-media-video-item .ss-video-play-btn::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 10px solid white;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    margin-left: 2px;
}

.ss-media-video-item .ss-video-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    border-radius: 4px;
}

.ss-copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    animation: ss-fadeIn 0.3s;
}

@keyframes ss-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== 移动端 ========== */
@media (max-width: 768px) {
    .ss-chat-btn {
        width: 52px;
        height: 52px;
        /* 抬高避开返回顶部按钮 + 底部安全区 */
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        right: 20px;
    }

    .ss-chat-btn.ss-left { left: 20px; }

    .ss-chat-btn svg { width: 24px; height: 24px; }

    .ss-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        transform: translateY(100%);
        bottom: 0;
    }

    .ss-chat-window.ss-active { transform: translateY(0); }
    .ss-chat-window.ss-left { left: 0; right: 0; }

    .ss-chat-header { padding: 14px 16px; position: relative; padding-top: calc(14px + env(safe-area-inset-top)); }

    /* 移动端顶部安全区域 */
    .ss-chat-window {
        padding-top: env(safe-area-inset-top);
    }

    /* 移动端：最幼化按钮暗藏 */

    /* 移动端：关关按钮（纯X） */
    .ss-chat-close {
        width: 32px;
        height: 32px;
        padding: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15) !important;
        border: none;
        opacity: 1;
        position: relative;
        font-size: 0;
    }

    .ss-chat-close::before {
        display: none;
    }

    .ss-chat-close:active {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(0.9);
    }

    .ss-chat-close svg,
    .ss-chat-close img {
        display: block !important;
        width: 18px !important;
        height: 18px !important;
        fill: white;
        margin: 0 auto;
    }

    .ss-chat-messages { padding: 12px; }

    .ss-message-content {
        font-size: 15px;
        padding: 10px 14px;
    }

    .ss-bubble-wrapper {
        max-width: 70%;
    }

    .ss-chat-input-area { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
    .ss-quick-questions { padding: 6px 12px; }
    .ss-quick-question-btn { font-size: 13px; padding: 7px 14px; }
}

/* 悬浮按钮暗藏动画 */
.ss-chat-btn.ss-hidden {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}
.ss-chat-btn {
    transition: opacity 0.3s ease, transform 0.3s ease;
}


/* ========== 移动端语音模式（豆包风格） ========== */
.ss-mobile-voice-mode .ss-input-wrapper,
.ss-mobile-voice-mode .ss-send-btn,
.ss-mobile-voice-mode .ss-lead-btn {
    display: none !important;
}

/* 底部语音操作条 */
.ss-mobile-voice-bar {
    display: none;
    flex: 1;
    position: relative;
    height: 44px;
    margin: 0 8px;
}
.ss-mobile-voice-mode .ss-mobile-voice-bar {
    display: flex;
}

/* 按住措辞按钮 */
.ss-mobile-voice-hold-btn {
    flex: 1;
    height: 44px;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s ease;
    position: relative;
    z-index: 10;
    cursor: pointer;
}
.ss-mobile-voice-hold-btn.pressed {
    background: #e0e0e0;
}

/* 移动端灌音气泡（豆包风格：底部渐变区域） */

/* ===== PC端灌音弹窗（居中卡片模式，对齐chat.html） ===== */
.ss-desktop-recording-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.ss-desktop-recording-modal.show {
    display: flex;
}
.ss-desktop-recording-card {
    background: rgba(50, 50, 50, 0.95);
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.ss-desktop-recording-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    gap: 4px;
    margin-bottom: 15px;
}
.ss-desktop-recording-wave span {
    display: inline-block;
    width: 4px;
    background: #fff;
    border-radius: 2px;
    animation: ssDesktopWave 1s ease-in-out infinite;
}
.ss-desktop-recording-wave span:nth-child(1) { height: 20px; animation-delay: 0s; }
.ss-desktop-recording-wave span:nth-child(2) { height: 35px; animation-delay: 0.1s; }
.ss-desktop-recording-wave span:nth-child(3) { height: 50px; animation-delay: 0.2s; }
.ss-desktop-recording-wave span:nth-child(4) { height: 35px; animation-delay: 0.3s; }
.ss-desktop-recording-wave span:nth-child(5) { height: 20px; animation-delay: 0.4s; }
.ss-desktop-recording-wave span:nth-child(6) { height: 35px; animation-delay: 0.5s; }
.ss-desktop-recording-wave span:nth-child(7) { height: 20px; animation-delay: 0.6s; }
@keyframes ssDesktopWave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.2); }
}
.ss-desktop-recording-text {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}
.ss-desktop-recording-time {
    color: #aaa;
    font-size: 13px;
    margin-top: 8px;
}
.ss-desktop-recording-stop-btn {
    margin-top: 20px;
    padding: 10px 36px;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.ss-desktop-recording-stop-btn:hover {
    background: #06ad56;
}
.ss-desktop-recording-hint {
    color: #888;
    font-size: 12px;
    margin-top: 12px;
}
/* ===== PC端灌音弹窗实现 ===== */

.ss-voice-recording-overlay {
    background: transparent !important;
    align-items: flex-end !important;
    justify-content: center !important;
    pointer-events: none !important;
}

/* 灌音底部区域（豆包风格） */
.ss-mobile-voice-bubble {
    width: 100%;
    padding: 40px 20px 80px;
    text-align: center;
    background: linear-gradient(180deg, rgba(22, 119, 255, 0) 0%, rgba(22, 119, 255, 0.5) 35%, rgba(22, 119, 255, 0.85) 100%);
    transition: background 0.2s ease;
    pointer-events: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
}
.ss-mobile-voice-bubble.show {
    display: block;
}
.ss-mobile-voice-bubble.cancel-mode {
    background: linear-gradient(180deg, rgba(250, 81, 81, 0) 0%, rgba(250, 81, 81, 0.5) 35%, rgba(250, 81, 81, 0.85) 100%);
}

.ss-bubble-text {
    font-size: 16px;
    color: #fff;
    margin-bottom: 24px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.ss-mobile-voice-bubble.cancel-mode .ss-bubble-text {
    color: #fa5151;
    text-shadow: none;
}

/* 声波条（豆包风格：密集竖线） */
.ss-bubble-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    gap: 2px;
}
.ss-bubble-wave span {
    display: inline-block;
    width: 3px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    transition: height 0.06s ease;
}
.ss-bubble-wave span.active {
    background: #fff;
}
.ss-mobile-voice-bubble.cancel-mode .ss-bubble-wave span {
    background: rgba(250, 81, 81, 0.4);
}
.ss-mobile-voice-bubble.cancel-mode .ss-bubble-wave span.active {
    background: #fa5151;
}

.ss-bubble-timer {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 16px;
}
.ss-mobile-voice-bubble.cancel-mode .ss-bubble-timer {
    color: rgba(250, 81, 81, 0.6);
}

/* ===== 语音转文字预览卡片 ===== */
.ss-voice-preview-card {
display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: flex-end;
    justify-content: center;
    padding: 0 20px 22vh 20px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
}
.ss-voice-preview-card.show {
    display: flex;
}
.ss-voice-preview-card-inner {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.ss-voice-preview-card-title {
    padding: 16px 20px 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
}
.ss-voice-preview-card-text {
    flex: 1;
    padding: 12px 20px;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    min-height: 100px;
    max-height: 50vh;
    overflow-y: auto;
    outline: none;
    word-break: break-all;
}
.ss-voice-preview-card-text:focus {
    background: #f9f9f9;
}
.ss-voice-preview-card-hint {
    padding: 4px 20px;
    font-size: 12px;
    color: #999;
    text-align: center;
}
.ss-voice-preview-card-actions {
    display: flex;
    gap: 12px;
    padding: 12px 20px 20px;
}
.ss-voice-preview-cancel-btn,
.ss-voice-preview-send-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.ss-voice-preview-cancel-btn {
    background: #f0f0f0;
    color: #666;
}
.ss-voice-preview-send-btn {
    background: #1677ff;
    color: #fff;
}
.ss-voice-preview-cancel-btn:active {
    opacity: 0.7;
}
.ss-voice-preview-send-btn:active {
    opacity: 0.8;
}
/* 加载状态 */
.ss-voice-preview-loading {
    display: none;
    padding: 30px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}
.ss-voice-preview-loading.show {
    display: block;
}
.ss-voice-preview-loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: ss-voice-preview-spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}
@keyframes ss-voice-preview-spin {
    to { transform: rotate(360deg); }
}

/* 语音按钮双图标切换（麦克风/键盘） */
.ss-voice-btn .voice-icon-keyboard {
    display: none;
}
.ss-mobile-voice-mode .ss-voice-btn .voice-icon-mic {
    display: none !important;
}
.ss-mobile-voice-mode .ss-voice-btn .voice-icon-keyboard {
    display: block !important;
}

/* 确保输入区定位高低文 */
.ss-chat-input-area {
    position: relative;
}


/* ========== 留资弹窗 ========== */
.ss-lead-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;

}
.ss-lead-modal-overlay.show {
    display: flex;
}
.ss-lead-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: ssLeadModalIn 0.2s ease;
}
@keyframes ssLeadModalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.ss-lead-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.ss-lead-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2329;
}
.ss-lead-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}
.ss-lead-modal-close:hover {
    background: #f5f5f5;
    color: #666;
}
.ss-lead-modal-body {
    padding: 20px 24px 24px;
}
.ss-form-group {
    margin-bottom: 16px;
}
.ss-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #4e5969;
    font-weight: 500;
}
.ss-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2329;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}
.ss-form-input:focus {
    border-color: var(--theme-color, #1677ff);
}
.ss-form-input::placeholder {
    color: #c9cdd4;
}
textarea.ss-form-input {
    resize: vertical;
    min-height: 60px;
}
.ss-lead-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--theme-color, #1677ff);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}
.ss-lead-submit-btn:hover {
    opacity: 0.9;
}
.ss-lead-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 移动端留资弹窗适配 */
@media (max-width: 768px) {
    .ss-lead-modal {
        width: 92%;
        margin: 0 16px;
    }
    .ss-lead-modal-header {
        padding: 16px 20px 12px;
    }
    .ss-lead-modal-body {
        padding: 16px 20px 20px;
    }
}


@media (max-width: 768px) {
    .ss-desktop-recording-modal { display: none !important; }
}

/* === v2.1 新增形状 === */


/* ============================================================
   === v2.1 新增形状 - 名片齐全版/快捷问题/新闻评分/图片预览 ===
   ============================================================ */

/* ========== 新版名片形状 ========== */
.ss-card-container {
    margin-top: 10px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
}

.ss-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    padding-left: 4px;
}

.ss-sales-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ss-sales-card:last-child {
    margin-bottom: 0;
}

.ss-sales-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ss-theme, #1677ff), var(--ss-theme-dark, #0e42d2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
    float: left;
    margin-right: 12px;
}

.ss-sales-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ss-sales-info {
    overflow: hidden;
}

.ss-sales-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.ss-sales-name-cn {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.ss-sales-position {
    display: inline-block;
    font-size: 12px;
    color: var(--ss-theme, #1677ff);
    background: var(--ss-theme-light, #e8f3ff);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

.ss-sales-contact {
    clear: both;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.ss-sales-contact-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    word-break: break-all;
}

.ss-sales-contact-item i {
    margin-right: 6px;
    font-style: normal;
    font-size: 14px;
}

.ss-sales-contact-item:last-child {
    margin-bottom: 0;
}

.ss-wechat-qr-wrap {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background: #fafafa;
    border-radius: 8px;
}

.ss-wechat-qr {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 6px;
}

.ss-qr-tip {
    font-size: 11px;
    color: #999;
    margin: 6px 0 0 0;
}

.ss-sales-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ss-card-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.ss-card-btn-primary {
    background: var(--ss-theme, #1677ff);
    color: white;
}

.ss-card-btn-primary:hover {
    background: var(--ss-theme-dark, #0e42d2);
}

.ss-card-btn-outline {
    background: white;
    color: var(--ss-theme, #1677ff);
    border: 1px solid var(--ss-theme, #1677ff);
}

.ss-card-btn-outline:hover {
    background: var(--ss-theme-light, #e8f3ff);
}

/* 经销商名片 */
.ss-distributor-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ss-distributor-card:last-child {
    margin-bottom: 0;
}

.ss-distributor-company {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.ss-distributor-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ss-distributor-brand-tag {
    font-size: 11px;
    color: #f59e0b;
    background: #fffbeb;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #fde68a;
}

.ss-distributor-info {
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

.ss-distributor-info-row {
    display: flex;
    align-items: flex-start;
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    word-break: break-all;
}

.ss-distributor-info-row i {
    margin-right: 6px;
    font-style: normal;
    flex-shrink: 0;
}

/* ========== 新闻快捷留资按钮 ========== */
.lead-quick-btn {
    margin-top: 8px;
}

.lead-quick-btn button {
    padding: 8px 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.lead-quick-btn button:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* ========== 新闻操作按钮（评分/复造/沉问/TTS） ========== */
.message-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    padding-left: 2px;
    opacity: 0.7;
    transition: opacity 0.2s;
    align-items: center;
}

.ss-message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

.action-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.action-btn.good.active {
    color: #10b981;
    background: #ecfdf5;
}

.action-btn.bad.active {
    color: #ef4444;
    background: #fef2f2;
}

.action-btn.copy-btn:hover {
    color: var(--ss-theme, #1677ff);
}

.action-btn.regenerate-btn:hover {
    color: #f59e0b;
}

.ss-tts-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.ss-tts-btn svg {
    width: 14px;
    height: 14px;
}

.ss-tts-btn:hover {
    background: #f0f0f0;
    color: var(--ss-theme, #1677ff);
}

.ss-tts-btn.playing {
    color: var(--ss-theme, #1677ff);
    background: var(--ss-theme-light, #e8f3ff);
}

/* 差评标签选择 */
.feedback-tags {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.feedback-tags.show {
    display: flex;
}

.tag-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover {
    border-color: var(--ss-theme, #1677ff);
    color: var(--ss-theme, #1677ff);
}

.tag-btn.active {
    background: var(--ss-theme, #1677ff);
    color: white;
    border-color: var(--ss-theme, #1677ff);
}

/* ========== 动态快捷问题条（吸附输入框上方） ========== */
.ss-quick-questions-bar {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    z-index: 5;
    pointer-events: none;
}

.ss-quick-questions-bar .quick-btn {
    pointer-events: auto;
    flex: 1;
    padding: 6px 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.ss-quick-questions-bar .quick-btn:hover {
    border-color: var(--ss-theme, #1677ff);
    color: var(--ss-theme, #1677ff);
    background: var(--ss-theme-light, #e8f3ff);
}

.ss-quick-questions-bar .quick-btn.primary {
    background: var(--ss-theme, #1677ff);
    color: white;
    border-color: var(--ss-theme, #1677ff);
}

.ss-quick-questions-bar .quick-btn.primary:hover {
    background: var(--ss-theme-dark, #0e42d2);
}

/* 输入区域相对定位 */
.ss-chat-input-area {
    position: relative;
}

/* ========== 图片预览 ========== */
.ss-image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.ss-image-preview-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
}

/* 新闻中的图片 */
.ss-message-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.ss-message-image:hover {
    transform: scale(1.02);
}

/* ========== 打字机光标 ========== */
.ss-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--ss-theme, #1677ff);
    margin-left: 2px;
    animation: ss-cursor-blink 1s infinite;
    vertical-align: text-bottom;
}

@keyframes ss-cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========== 视频预览 ========== */
.ss-video-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ss-video-preview-modal video {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.ss-video-preview-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
}

/* ========== 气泡包裹层（新闻操作+标签用） ========== */
.ss-bubble-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    min-width: 120px;
}

.ss-user .ss-bubble-wrapper {
    min-width: 100px;
}

.ss-user .ss-bubble-wrapper {
    align-items: flex-end;
}

.ss-bot .ss-bubble-wrapper {
    align-items: flex-start;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .ss-sales-actions {
        flex-direction: column;
    }
    
    .ss-card-btn {
        min-width: 100%;
    }
    
    .ss-wechat-qr {
        width: 80px;
        height: 80px;
    }
    
    .ss-message-image {
        width: 90px;
        height: 90px;
    }
    
    .ss-quick-questions-bar {
        padding-right: 70px !important;
    }
    
    .ss-bubble-wrapper {
        max-width: 75%;
    }
}

/* ========== v2.2 图片上传按钮 ========== */
.ss-image-btn {
    z-index: 10;
    pointer-events: auto;
    position: relative;

    background: none;
    border: none;
    color: var(--ss-text-secondary, #86909C);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    transition: all 0.2s;
    width: 38px;
    height: 38px;
}

.ss-image-btn:hover {
    color: var(--ss-theme, #165DFF);
    background: var(--ss-theme-light, #E8F3FF);
}

.ss-image-btn:active {
    transform: scale(0.95);
}

/* ========== v2.2 图片预览条（发送前） ========== */
.ss-image-preview-bar {
    padding: 8px 16px;
    border-top: 1px solid var(--ss-border, #E5E6EB);
    border-bottom: none;
    background: #FAFBFC;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.ss-image-preview-list {
    display: flex;
    gap: 8px;
    align-items: stretch;
    min-height: 60px;
    justify-content: flex-start;
}

.ss-image-preview-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    aspect-ratio: 1 / 1;
    max-width: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ss-border, #E5E6EB);
}

.ss-image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ss-image-preview-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
}

.ss-image-preview-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ========== v2.2 用户新闻图片 ========== */
.ss-user-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    max-width: 200px;
}

.ss-user .ss-user-images {
    justify-content: flex-end;
}

.ss-user-image-item {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.ss-user-image-item:hover {
    transform: scale(1.02);
}

.ss-user-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 单张图片时更大 */
.ss-user-images .ss-user-image-item:first-child:nth-last-child(1) {
    width: 140px;
    height: 140px;
}

/* 移动端用户图片调整 */
@media (max-width: 480px) {
    .ss-image-btn {
        padding: 6px;
    }
    
    .ss-image-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .ss-image-preview-item {
        width: 50px;
        height: 50px;
    }
    
    .ss-user-images {
        max-width: 160px;
    }
    
    .ss-user-image-item {
        width: 60px;
        height: 60px;
    }
    
    .ss-user-images .ss-user-image-item:first-child:nth-last-child(1) {
        width: 110px;
        height: 110px;
    }
}

/* ========== v2.2 移动端键盘适配有关 ========== */
.ss-chat-window.ss-keyboard-open {
    transition: bottom 0.2s ease-out;
}

/* iOS 安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .ss-chat-window {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}
<!--耗时1784909392.5926秒-->