/* ========== 客服按钮（100%保持原样） ========== */
#svc-button {
    position: fixed;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #c03;
    color: white;
    font-size: 30px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 99999;
    transition: all 0.3s ease;
    pointer-events: auto;
    visibility: visible !important;
    opacity: 1 !important;
}
@media (min-width: 768px) {
    #svc-button {
        bottom: 30px;
        top: auto;
    }
}
@media (max-width: 767px) {
    #svc-button {
        top: 50%;
        transform: translateY(-50%);
        bottom: auto;
    }
}

/* ========== 聊天窗口（100%保持原样） ========== */
#svc-chatbox {
    position: fixed !important;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 99998;
    overflow: hidden;
    pointer-events: auto;
    display: none !important;
    flex-direction: column !important;
}
#svc-chatbox.svc-open {
    display: flex !important;
}
@media (min-width: 768px) {
    #svc-chatbox {
        bottom: 100px;
        top: auto;
        right: 20px;
        width: 380px;
        height: 580px;
    }
}
@media (max-width: 767px) {
    #svc-chatbox {
        top: 50%;
        transform: translateY(-50%);
        right: 10px;
        width: 90%;
        max-width: 380px;
        bottom: auto;
        height: 80vh;
    }
}

/* ========== 头部、欢迎语、快捷按钮（100%保持原样） ========== */
#svc-header {
    background: #c03;
    padding: 15px;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    border-radius: 12px 12px 0 0;
    position: relative;
    flex-shrink: 0;
}
#svc-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
}
#svc-welcome {
    padding: 15px;
    background: #f9f9f9;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
#svc-quick-options {
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #eee;
    text-align: center;
    flex-shrink: 0;
}
.svc-quick-btn {
    margin: 5px;
    padding: 6px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
}
.svc-quick-btn:hover {
    background: #e0e0e0;
}

/* ========== 消息容器（100%保持原样） ========== */
#svc-history {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 15px;
    background-color: #fcfcfc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========== 消息气泡（100%保持原样） ========== */
.svc-message-user {
    text-align: right;
    margin-left: auto;
    align-self: flex-end;
}
.svc-message-user .svc-message-content {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.svc-message-ai {
    text-align: left;
    margin-right: auto;
    align-self: flex-start;
}
.svc-message-ai .svc-message-content {
    display: inline-block;
    background: #e9ecef;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    max-width: 80%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.svc-message-system {
    text-align: center;
    margin: 0 auto;
    align-self: center;
    max-width: 90%;
}
.svc-message-system .svc-message-content {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #ffeaa7;
}

/* ========== 输入框区域（100%保持原样） ========== */
#svc-footer {
    padding: 8px 15px;
    border-top: 1px solid #eee;
    background: #fff;
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    flex-shrink: 0;
}
#svc-question {
    flex: 1 !important;
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    margin: 0 !important;
    outline: none !important;
}
#svc-send {
    padding: 12px 22px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0 !important;
}
#svc-send:hover:not(:disabled) {
    background: #0056b3;
}
#svc-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========== 免责声明（100%保持原样） ========== */
#svc-disclaimer {
    padding: 10px 15px;
    font-size: 12px;
    color: #666;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
#svc-disclaimer a {
    color: #c03;
    text-decoration: none;
}
#svc-disclaimer a:hover {
    text-decoration: underline;
}

/* ========== 思考状态动画（新增，不影响原有） ========== */
.svc-message-thinking {
    opacity: 0.8;
}
.svc-message-thinking .svc-message-content {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: #f0f0f0 !important;
    color: #666 !important;
    padding: 10px 16px !important;
    border-radius: 16px !important;
    font-size: 13px;
}
.svc-thinking-dots {
    display: inline-flex;
    gap: 4px;
}
.svc-thinking-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: svcThinkingBounce 1.4s infinite ease-in-out both;
}
.svc-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.svc-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes svcThinkingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ========== 打字机动画（新增，不影响原有） ========== */
.svc-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #007bff;
    margin-left: 2px;
    animation: svcTypingBlink 1s infinite;
}
@keyframes svcTypingBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========== 滚动条美化（100%保持原样） ========== */
#svc-history::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}
#svc-history::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 3px !important;
}
#svc-history::-webkit-scrollbar-thumb {
    background: #ccc !important;
    border-radius: 3px !important;
}
#svc-history::-webkit-scrollbar-thumb:hover {
    background: #999 !important;
}

/* ========== 时间戳隐藏 ========== */
.svc-time {
    display: none !important;
}

/* ========== 消息淡入动画（新增，轻量级） ========== */
@keyframes svcFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.svc-message {
    animation: svcFadeIn 0.3s ease-out;
}