/**
 * 咨询侧边栏样式
 * Chat Sidebar Module
 */

/* 根变量 - 主题颜色 */
:root {
    --chat-primary: #dc3545;
    --chat-primary-dark: #c82333;
    --chat-primary-light: rgba(220, 53, 69, 0.1);
    --chat-bg: #fff;
    --chat-text: #333;
    --chat-text-light: #666;
    --chat-border: #e0e0e0;
    --chat-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 主容器 */
.chat-sidebar {
    position: fixed;
    right: 0;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 全屏模式下降低层级，确保在导航栏下方 */
.chat-sidebar.position-full {
    z-index: 999;
}

/* ========== 显示位置 ========== */
/* 靠近顶部 */
.chat-sidebar.position-top {
    top: 100px;
    transform: none;
}

/* 中部（默认） */
.chat-sidebar.position-center {
    top: 50%;
    transform: translateY(-50%);
}

/* 靠近底部 */
.chat-sidebar.position-bottom {
    bottom: 100px;
    top: auto;
    transform: none;
}

/* 拉伸全屏 - 基础定义（会被后面的覆盖） */
.chat-sidebar.position-full {
    top: 0;
    bottom: 0;
    transform: none;
}

/* ========== 全屏模式（拉伸全屏） ========== */
/* 全屏模式下，侧边栏占满整个视口高度，无圆角，无间距 */
.chat-sidebar.position-full {
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    border-radius: 0 !important;
}

/* 确保全框内容始终横向排列 */
.chat-sidebar.full .chat-full-content {
    display: flex !important;
    flex-direction: row !important;
}

/* 窄条状态在全屏模式下 */
.chat-sidebar.narrow.position-full {
    height: 100vh !important;
}

.chat-sidebar.narrow.position-full .chat-narrow-content,
.chat-sidebar.narrow.position-full .chat-narrow-btn {
    height: 100%;
    border-radius: 0;
}

/* 半框状态在全屏模式下 */
.chat-sidebar.half.position-full {
    width: 280px;
}

.chat-sidebar.half.position-full .chat-half-content {
    height: 100vh;
    border-radius: 0;
    display: flex !important;
    flex-direction: column;
}

.chat-sidebar.half.position-full .chat-messages {
    flex: 1;
    overflow-y: auto;
}

/* 全框状态在全屏模式下 */
.chat-sidebar.full.position-full {
    width: 100%;
    max-width: 600px;
}

.chat-sidebar.full.position-full .chat-full-content {
    height: 100vh;
    border-radius: 0;
    display: flex !important;
    flex-direction: row !important;
}

.chat-sidebar.full.position-full .chat-left-panel {
    border-radius: 0;
}

.chat-sidebar.full.position-full .chat-right-panel {
    display: flex;
    flex-direction: column;
}

.chat-sidebar.full.position-full .chat-messages {
    flex: 1;
    overflow-y: auto;
}

/* ========== 窄条状态（收起） ========== */
.chat-sidebar.narrow {
    width: 60px;
    height: 200px;
}

/* 满高窄条状态 */
.chat-sidebar.narrow.full-height {
    height: 100vh !important;
    top: 0 !important;
    bottom: 0 !important;
    transform: none !important;
}

.chat-sidebar.narrow .chat-narrow-btn {
    width: 60px;
    height: 100%;
    background: var(--chat-primary);
    border-radius: 8px 0 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: visible;
    box-shadow: var(--chat-shadow);
    transition: all 0.3s ease;
    z-index: 10001;
}

.chat-sidebar.narrow .chat-narrow-btn:hover {
    background: var(--chat-primary-dark);
    width: 80px;
}

.chat-sidebar.narrow .chat-narrow-btn .btn-icon {
    font-size: 24px;
    color: #fff;
    margin-bottom: 8px;
}

.chat-sidebar.narrow .chat-narrow-btn .btn-text {
    writing-mode: vertical-rl;
    letter-spacing: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* 满高窄条模式下的内侧按钮 */
.chat-sidebar.narrow .chat-narrow-btn.has-inner-buttons {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 10px;
}

/* 非满高模式窄条底部外侧按钮 */
.chat-sidebar.narrow .chat-narrow-content.has-bottom-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-sidebar.narrow .chat-narrow-bottom-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.chat-sidebar.narrow .chat-narrow-bottom-btn {
    width: 50px;
    height: 50px;
    background: var(--chat-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: var(--chat-shadow);
    position: relative;
}

/* 非满高模式窄条底部按钮边缘流光效果 */
.chat-sidebar.narrow .chat-narrow-bottom-btn {
    position: relative;
    overflow: hidden;
}

.chat-sidebar.narrow .chat-narrow-bottom-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, #ffd700, #fff, transparent);
    background-size: 200% 100%;
    animation: edgeGlow 2s linear infinite;
    z-index: 1;
}

.chat-sidebar.narrow .chat-narrow-bottom-btn:hover::before {
    animation-duration: 1s;
}

.chat-sidebar.narrow .chat-narrow-bottom-btn:hover {
    background: var(--chat-primary-dark);
    transform: scale(1.05);
}

.chat-sidebar.narrow .chat-narrow-bottom-btn:hover::before {
    background: conic-gradient(from 0deg, transparent 20%, rgba(255,255,255,0.8) 50%, rgba(255,215,0,0.7) 70%, transparent 90%);
    animation-duration: 1s;
}

.chat-sidebar.narrow .chat-narrow-center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.chat-sidebar.narrow .chat-narrow-inner-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding-bottom: 10px;
}

.chat-sidebar.narrow .chat-narrow-btn-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.chat-sidebar.narrow .chat-narrow-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 窄条满高按钮旋转流光效果 */
.chat-sidebar.narrow .chat-narrow-inner-buttons {
    position: relative;
}

.chat-sidebar.narrow .chat-narrow-btn-icon {
    position: relative;
    overflow: visible;
}

/* 按钮底部边缘旋转流光效果 */
.chat-sidebar.narrow .chat-narrow-btn-icon {
    position: relative;
    overflow: hidden;
}

.chat-sidebar.narrow .chat-narrow-btn-icon::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, #ffd700, #fff, transparent);
    background-size: 200% 100%;
    animation: edgeGlow 2s linear infinite;
    z-index: 1;
}

@keyframes edgeGlow {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 悬停时流光加速 */
.chat-sidebar.narrow .chat-narrow-btn-icon:hover::before {
    animation-duration: 1s;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 半宽全高咨询框的滚动按钮 - 绝对定位叠在按钮两侧 */
.chat-consult-btn-wrapper {
    position: relative;
    display: inline-block;
}

.chat-half-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    z-index: 10;
}

.chat-half-scroll-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.chat-half-scroll-btn.left {
    left: 18px;
}

.chat-half-scroll-btn.right {
    right: 18px;
}

/* 半宽按钮旋转流光效果 */
.chat-half-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* 半宽按钮底部边缘流光效果 */
.chat-half-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    overflow: hidden;
    white-space: nowrap;
}

.chat-half-scroll-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, #ffd700, #fff, transparent);
    background-size: 200% 100%;
    animation: edgeGlow 2s linear infinite;
    z-index: 1;
}

.chat-half-scroll-btn:hover::before {
    animation-duration: 1s;
}

.chat-half-scroll-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-50%) scale(1.1);
}



/* 全宽咨询框左侧底部按钮 */
.chat-full-left-buttons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
}

.chat-full-btn-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    position: relative;
}

/* 全宽按钮底部边缘流光效果 */
.chat-full-btn-icon {
    position: relative;
    overflow: hidden;
}

.chat-full-btn-icon::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, #ffd700, #fff, transparent);
    background-size: 200% 100%;
    animation: edgeGlow 2s linear infinite;
    z-index: 1;
}

.chat-full-btn-icon:hover::before {
    animation-duration: 1s;
}

/* 左侧面板需要相对定位 */
.chat-left-panel {
    position: relative;
}

/* 悬停显示的图片容器 - 默认中部对齐 */
.chat-sidebar.narrow .chat-hover-images {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
    max-height: 80vh;
    justify-content: center;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    min-width: 140px;
}

/* 顶部位置 - 悬停图片顶部对齐 */
.chat-sidebar.narrow.position-top .chat-hover-images {
    top: 0;
    transform: translateX(10px);
    justify-content: flex-start;
}

/* 中部位置 - 悬停图片居中对齐（默认） */
.chat-sidebar.narrow.position-center .chat-hover-images {
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    justify-content: center;
}

/* 底部位置 - 悬停图片底部对齐 */
.chat-sidebar.narrow.position-bottom .chat-hover-images {
    top: auto;
    bottom: 0;
    transform: translateX(10px);
    justify-content: flex-end;
}

/* 全屏模式下悬停图片容器占满高度 */
.chat-sidebar.narrow.position-full .chat-hover-images {
    top: 0;
    bottom: 0;
    transform: translateX(10px);
    max-height: 100vh;
}

/* 默认中部位置悬停 */
.chat-sidebar.narrow.position-center .chat-narrow-btn:hover .chat-hover-images,
.chat-sidebar.narrow.position-center .chat-narrow-btn.hover-active .chat-hover-images {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* 顶部位置悬停 */
.chat-sidebar.narrow.position-top .chat-narrow-btn:hover .chat-hover-images,
.chat-sidebar.narrow.position-top .chat-narrow-btn.hover-active .chat-hover-images {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 底部位置悬停 */
.chat-sidebar.narrow.position-bottom .chat-narrow-btn:hover .chat-hover-images,
.chat-sidebar.narrow.position-bottom .chat-narrow-btn.hover-active .chat-hover-images {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 全屏模式下悬停 */
.chat-sidebar.narrow.position-full .chat-narrow-btn:hover .chat-hover-images,
.chat-sidebar.narrow.position-full .chat-narrow-btn.hover-active .chat-hover-images {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 调试：强制显示 */
.chat-sidebar.narrow .chat-hover-images.debug-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    border: 2px solid red;
}

/* 单个悬停图片项 */
.chat-sidebar.narrow .chat-hover-image-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--chat-shadow);
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.chat-sidebar.narrow .chat-hover-image-item img {
    width: 120px;
    height: 120px;
    border-radius: 4px;
    object-fit: cover;
}

.chat-sidebar.narrow .chat-hover-image-desc {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 半框状态 ========== */
.chat-sidebar.half {
    width: 280px;
    height: 500px;
    background: var(--chat-bg);
    border-radius: 12px 0 0 12px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 半框内容区域 */
.chat-sidebar.half .chat-half-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 头部 - 超紧凑高度 */
.chat-sidebar .chat-header {
    background: var(--chat-primary);
    color: #fff;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    font-size: 14px;
}

.chat-sidebar .chat-header-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-sidebar .chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-sidebar .chat-header-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

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

/* 消息列表区域 */
.chat-sidebar .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    min-height: 0;
    position: relative;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

/* 隐藏滚动条 */
.chat-sidebar .chat-messages::-webkit-scrollbar {
    display: none;
}

/* 半框消息区域 */
.chat-sidebar.half .chat-messages {
    flex: 1;
    overflow-y: auto;
}

/* 滚动提示箭头 */
.chat-scroll-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.chat-scroll-hint.visible {
    opacity: 1;
}

.chat-scroll-hint.down {
    bottom: 10px;
    animation: bounceDown 1.5s infinite;
}

.chat-scroll-hint.up {
    top: 10px;
    animation: bounceUp 1.5s infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}

@keyframes bounceUp {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.chat-sidebar .chat-message {
    margin-bottom: 15px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-sidebar .chat-message-user {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.chat-sidebar .chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--chat-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-sidebar .chat-message-content {
    flex: 1;
    background: #fff;
    padding: 12px;
    border-radius: 12px 12px 12px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-sidebar .chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-sidebar .chat-message-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--chat-text);
}

.chat-sidebar .chat-message-text {
    font-size: 14px;
    color: var(--chat-text);
    line-height: 1.5;
}

.chat-sidebar .chat-message-time {
    font-size: 11px;
    color: var(--chat-text-light);
}

.chat-sidebar .chat-message-reply {
    margin-top: 8px;
    padding: 10px;
    background: var(--chat-primary-light);
    border-radius: 8px;
    font-size: 13px;
    color: var(--chat-primary-dark);
    border-left: 3px solid var(--chat-primary);
}

/* 空状态 */
.chat-sidebar .chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--chat-text-light);
}

.chat-sidebar .chat-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 底部区域 */
.chat-sidebar .chat-footer {
    background: #fff;
    border-top: 1px solid var(--chat-border);
    display: flex;
    flex-direction: column;
    margin-top: auto;
}

/* 半框footer固定在底部 */
.chat-sidebar.half .chat-footer {
    margin-top: auto;
}

/* 半框底部图片 - 在footer内底部显示 */
.chat-sidebar.half .chat-footer .chat-bottom-images {
    order: 2;
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid var(--chat-border);
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
}

.chat-sidebar.half .chat-footer .chat-bottom-images .chat-bottom-image-item img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 咨询按钮在图片上方 */
.chat-sidebar.half .chat-footer .chat-consult-btn {
    order: 1;
}

/* 咨询按钮（半框状态） */
.chat-sidebar.half .chat-consult-btn {
    width: 100%;
    padding: 10px;
    background: var(--chat-primary);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.chat-sidebar.half .chat-consult-btn:hover {
    background: var(--chat-primary-dark);
}

.chat-sidebar.half .chat-consult-btn .hover-img {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--chat-shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 5px;
    margin-bottom: 10px;
}

.chat-sidebar.half .chat-consult-btn:hover .hover-img {
    opacity: 1;
    visibility: visible;
}

.chat-sidebar.half .chat-consult-btn .hover-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* 展开的消息输入区域 */
.chat-sidebar .chat-input-area {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.chat-sidebar .chat-input-area.expanded {
    max-height: 300px;
}

.chat-sidebar .chat-input-form {
    padding: 15px;
}

.chat-sidebar .chat-input-form input,
.chat-sidebar .chat-input-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--chat-border);
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.chat-sidebar .chat-input-form input:focus,
.chat-sidebar .chat-input-form textarea:focus {
    outline: none;
    border-color: var(--chat-primary);
}

.chat-sidebar .chat-input-form textarea {
    resize: none;
    min-height: 80px;
}

.chat-sidebar .chat-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--chat-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-sidebar .chat-submit-btn:hover {
    background: var(--chat-primary-dark);
}

.chat-sidebar .chat-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ========== 全框状态 ========== */
.chat-sidebar.full {
    width: 600px;
    height: 800px;
    background: var(--chat-bg);
    border-radius: 12px 0 0 12px;
    box-shadow: var(--chat-shadow);
    display: flex !important;
    flex-direction: row !important;
    overflow: hidden;
}

/* 全框状态下根据位置设置显示 */
/* 顶部显示：距离顶部 100px */
.chat-sidebar.full.position-top {
    top: 100px !important;
    bottom: auto !important;
    transform: none !important;
}

/* 中部显示：垂直居中 */
.chat-sidebar.full.position-center {
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}

/* 底部显示：距离底部 100px */
.chat-sidebar.full.position-bottom {
    top: auto !important;
    bottom: 100px !important;
    transform: none !important;
}

/* 左侧图片区域 */
.chat-sidebar.full .chat-left-panel {
    width: 200px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #fff;
    overflow-y: auto;
}

/* 根据位置设置调整左侧面板对齐方式 */
/* 顶部位置：图片从顶部开始排列 */
.chat-sidebar.full.position-top .chat-left-panel {
    justify-content: flex-start;
}

/* 中部位置：图片垂直居中 */
.chat-sidebar.full.position-center .chat-left-panel {
    justify-content: center;
}

/* 底部位置：图片从底部开始排列 */
.chat-sidebar.full.position-bottom .chat-left-panel {
    justify-content: flex-end;
}

/* 全屏位置：图片垂直居中 */
.chat-sidebar.full.position-full .chat-left-panel {
    justify-content: center;
}

/* 左侧图片列表容器 */
.chat-sidebar.full .chat-left-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
}

/* 单个左侧图片项 */
.chat-sidebar.full .chat-left-image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chat-sidebar.full .chat-left-image-item img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chat-sidebar.full .chat-left-image-desc {
    font-size: 12px;
    text-align: center;
    opacity: 0.9;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 兼容旧版单张图片样式 */
.chat-sidebar.full .chat-left-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chat-sidebar.full .chat-left-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 右侧内容区域 */
.chat-sidebar.full .chat-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-sidebar.full .chat-header {
    border-radius: 0;
}

.chat-sidebar.full .chat-messages {
    flex: 1;
}

.chat-sidebar.full .chat-input-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.chat-sidebar.full .chat-input-form input:first-child {
    grid-column: 1;
}

.chat-sidebar.full .chat-input-form input:nth-child(2) {
    grid-column: 2;
}

.chat-sidebar.full .chat-input-form textarea {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.chat-sidebar.full .chat-submit-btn {
    grid-column: 1 / -1;
    margin-top: 10px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .chat-sidebar.full {
        width: 100%;
        height: 100%;
        top: 0;
        transform: none;
        border-radius: 0;
    }
    
    .chat-sidebar.full .chat-left-panel {
        display: none;
    }
    
    .chat-sidebar.half {
        width: 100%;
        height: 100%;
        top: 0;
        transform: none;
        border-radius: 0;
    }
}

/* ========== 底部图片样式 ========== */
/* 半框底部图片 - 在footer内底部显示 */
.chat-sidebar.half .chat-footer .chat-bottom-images {
    order: 3;
    padding: 10px;
    background: #f8f9fa;
    border-top: 1px solid var(--chat-border);
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
}

.chat-sidebar.half .chat-footer .chat-bottom-images .chat-bottom-image-item {
    flex: 1;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-sidebar.half .chat-footer .chat-bottom-images .chat-bottom-image-item img {
    width: 100%;
    height: auto;
    max-width: 120px;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-sidebar.half .chat-footer .chat-bottom-images .chat-bottom-image-desc {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 5px;
    width: 100%;
}

/* 咨询按钮在图片上方 */
.chat-sidebar.half .chat-footer .chat-consult-btn {
    order: 2;
}

/* 滚动条样式 */
.chat-sidebar ::-webkit-scrollbar {
    width: 6px;
}

.chat-sidebar ::-webkit-scrollbar-track {
    background: transparent;
}

.chat-sidebar ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-sidebar ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
