/* ========== 咸宁市九九五医院 - 智能导诊助手样式 ========== */

/* 悬浮按钮 */
.jjw-chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #01562d 0%, #027a42 100%);
    box-shadow: 0 4px 20px rgba(1, 86, 45, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.jjw-chat-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(1, 86, 45, 0.5);
}

.jjw-chat-fab svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.jjw-chat-fab .jjw-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4d4f;
    color: white;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.3;
    font-weight: normal;
}

/* 聊天窗口 */
.jjw-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 370px;
    height: 540px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    animation: jjwSlideUp 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.jjw-chat-window.jjw-open {
    display: flex;
}

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

/* 聊天头部 */
.jjw-chat-header {
    background: linear-gradient(135deg, #01562d 0%, #027a42 100%);
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.jjw-chat-header .jjw-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jjw-chat-header .jjw-avatar {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.jjw-chat-header .jjw-title-text h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px 0;
    color: white;
    line-height: 1.3;
}

.jjw-chat-header .jjw-title-text p {
    font-size: 11px;
    opacity: 0.85;
    margin: 0;
    line-height: 1.2;
}

.jjw-chat-header .jjw-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.85;
    transition: opacity 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.jjw-chat-header .jjw-close-btn:hover {
    opacity: 1;
}

/* 快捷信息栏 */
.jjw-quick-info {
    background: #e8f5ed;
    padding: 8px 14px;
    display: flex;
    justify-content: space-around;
    font-size: 11px;
    flex-shrink: 0;
    border-bottom: 1px solid #b3dcc2;
}

.jjw-quick-info .jjw-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #01562d;
}

.jjw-quick-info .jjw-info-item svg {
    width: 13px;
    height: 13px;
    fill: #01562d;
    flex-shrink: 0;
}

.jjw-quick-info .jjw-info-item a {
    color: #01562d;
    text-decoration: none;
}

/* 消息区域 */
.jjw-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f6faf7;
}

.jjw-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.jjw-chat-messages::-webkit-scrollbar-thumb {
    background: #c8d8ce;
    border-radius: 3px;
}

.jjw-message {
    display: flex;
    margin-bottom: 12px;
    max-width: 85%;
}

.jjw-message.jjw-bot {
    align-self: flex-start;
}

.jjw-message.jjw-user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.jjw-message .jjw-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.jjw-message.jjw-bot .jjw-msg-avatar {
    background: #e8f5ed;
    margin-right: 7px;
}

.jjw-message.jjw-user .jjw-msg-avatar {
    background: #01562d;
    margin-left: 7px;
}

.jjw-message .jjw-msg-content {
    padding: 9px 13px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.jjw-message.jjw-bot .jjw-msg-content {
    background: white;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #333;
}

.jjw-message.jjw-user .jjw-msg-content {
    background: #01562d;
    color: white;
    border-bottom-right-radius: 3px;
}

.jjw-message .jjw-msg-content a {
    color: #01562d;
    text-decoration: underline;
}

.jjw-message.jjw-user .jjw-msg-content a {
    color: #b3ffd1;
}

.jjw-message .jjw-msg-source {
    font-size: 10px;
    color: #999;
    margin-top: 3px;
}

/* 快捷问题 */
.jjw-quick-questions {
    padding: 8px 14px;
    background: white;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.jjw-quick-questions .jjw-quick-title {
    font-size: 11px;
    color: #999;
    margin-bottom: 7px;
}

.jjw-quick-questions .jjw-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jjw-quick-questions .jjw-quick-btn {
    background: #f0f7f3;
    color: #01562d;
    border: 1px solid #b3dcc2;
    padding: 5px 11px;
    border-radius: 14px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
    white-space: nowrap;
}

.jjw-quick-questions .jjw-quick-btn:hover {
    background: #01562d;
    color: white;
    border-color: #01562d;
}

/* 输入区域 */
.jjw-chat-input-area {
    padding: 10px 14px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.jjw-chat-input-area textarea {
    flex: 1;
    border: 1px solid #d9d9d9;
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 13px;
    resize: none;
    height: 36px;
    max-height: 90px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.jjw-chat-input-area textarea:focus {
    border-color: #01562d;
}

.jjw-chat-input-area .jjw-send-btn {
    background: #01562d;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 0 14px;
    height: 36px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.jjw-chat-input-area .jjw-send-btn:hover {
    background: #027a42;
}

.jjw-chat-input-area .jjw-send-btn:disabled {
    background: #bfbfbf;
    cursor: not-allowed;
}

/* 正在输入提示 */
.jjw-typing-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
}

.jjw-typing-indicator span {
    width: 5px;
    height: 5px;
    background: #bfbfbf;
    border-radius: 50%;
    animation: jjwTyping 1.4s infinite ease-in-out;
}

.jjw-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.jjw-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.jjw-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes jjwTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/* 免责声明 */
.jjw-disclaimer {
    text-align: center;
    font-size: 10px;
    color: #999;
    padding: 5px 14px;
    background: #fafafa;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .jjw-chat-window {
        width: 100%;
        height: calc(100vh - 60px);
        bottom: 0;
        right: 0;
        border-radius: 14px 14px 0 0;
    }

    .jjw-chat-fab {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }

    .jjw-chat-fab svg {
        width: 22px;
        height: 22px;
    }
}
