body {
    background: #f6f7f9;
    color: #222;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.chat-container {
    max-width: 600px;
    margin: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    overflow: hidden;
}

.chat-box {
    height: 400px;
    overflow-y: auto;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.message {
    margin: 10px 0;
}

.user-message {
    text-align: right;
}

.bot-message {
    text-align: left;
    color: #666;
}

.input-container {
    display: flex;
    padding: 10px;
}

.input-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #222;
}

.input-container button {
    padding: 10px 15px;
    margin-left: 10px;
    border: none;
    background-color: #e0e0e0;
    color: #222;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.input-container button:hover {
    background-color: #bdbdbd;
    color: #fff;
    transform: scale(1.08);
}

#chatbot-circle {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 62px;
    height: 62px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    border: 2px solid #e0e0e0;
    transition: box-shadow 0.2s, transform 0.2s, border 0.2s;
    animation: popIn 0.4s;
}
#chatbot-circle:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    transform: scale(1.08) rotate(-6deg);
    border-color: #bdbdbd;
    background: #f2f2f2;
}
#chatbot-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 其他聊天視窗與訊息泡泡樣式同你現有設計 */

#chatbot-widget {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 340px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 18px 18px 0 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    z-index: 9999;
    font-family: 'Segoe UI', Arial, sans-serif;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 0.3s cubic-bezier(.4,2,.6,1);
    animation: fadeInUp 0.5s;
}
#chatbot-widget.open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#chat-header {
    background: linear-gradient(90deg, #f7f7f7 60%, #e0e0e0 100%);
    color: #333;
    padding: 14px 16px;
    border-radius: 18px 18px 0 0;
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 1px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

#close-btn {
    font-size: 20px;
    font-weight: normal;
    margin-left: 10px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}
#close-btn:hover {
    color: #222;
}

#chat-history {
    height: 260px;
    overflow-y: auto;
    padding: 16px 12px 8px 12px;
    background: #f6f7f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.5s;
}

#chat-input-area {
    display: flex;
    padding: 10px;
    background: #f2f2f2;
    border-radius: 0 0 18px 18px;
}

#chat-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    margin-right: 8px;
    background: #fff;
    color: #222;
    transition: border 0.2s;
}
#chat-input:focus {
    border: 1.5px solid #bdbdbd;
}

#send-btn {
    width: 44px;
    background: #e0e0e0;
    color: #222;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
#send-btn:hover {
    background: #bdbdbd;
    color: #fff;
    transform: scale(1.08);
}

/* 訊息泡泡 */
.user-msg {
    align-self: flex-end;
    background: #e0e0e0;
    color: #222;
    padding: 8px 14px;
    border-radius: 16px 16px 2px 16px;
    max-width: 80%;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    animation: fadeInRight 0.3s;
}
.bot-msg {
    align-self: flex-start;
    background: #fff;
    color: #666;
    padding: 8px 14px;
    border-radius: 16px 16px 16px 2px;
    max-width: 80%;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    animation: fadeInLeft 0.3s;
}
.admin-msg {
    align-self: flex-start;
    background: #fafafa;
    color: #388e3c;
    padding: 8px 14px;
    border-radius: 16px 16px 16px 2px;
    max-width: 80%;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(56,142,60,0.08);
    animation: fadeInLeft 0.3s;
    border: 1.5px solid #bdbdbd;
}
.msg-bubble.animate-in {
    animation: popIn 0.3s;
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px);}
    to { opacity: 1; transform: translateX(0);}
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px);}
    to { opacity: 1; transform: translateX(0);}
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.8);}
    to { opacity: 1; transform: scale(1);}
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px);}
    to { opacity: 1; transform: translateY(0);}
}
@keyframes fadeIn {
    from { opacity: 0;}
    to { opacity: 1;}
}

/* 管理面板灰白風格 */
#container {
    display: flex;
    max-width: 900px;
    margin: 30px auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    overflow: hidden;
}
#user-list {
    width: 200px;
    background: #f2f2f2;
    border-right: 1.5px solid #e0e0e0;
    padding: 24px 0 0 0;
    min-height: 420px;
}
#user-list h4 {
    text-align: center;
    color: #888;
    margin-bottom: 18px;
    letter-spacing: 1px;
}
#user-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#user-list li {
    margin: 0;
}
#user-list a {
    display: block;
    padding: 12px 24px;
    color: #333;
    text-decoration: none;
    border-radius: 0 20px 20px 0;
    transition: background 0.2s, color 0.2s;
}
#user-list a:hover, #user-list a.active {
    background: #e0e0e0;
    color: #388e3c;
    font-weight: bold;
}
#chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    position: relative;
    background: #fff;
}
#panel-title {
    margin: 20px 0 0 0;
    padding: 0 24px;
    color: #333;
    font-size: 20px;
    letter-spacing: 1px;
}
#history {
    flex: 1;
    margin: 18px 24px 0 24px;
    padding: 16px 10px 10px 10px;
    background: #f6f7f9;
    border-radius: 12px;
    border: 1.5px solid #e0e0e0;
    overflow-y: auto;
    min-height: 260px;
    max-height: 340px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 0.5s;
}
#reply-box {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: #f2f2f2;
    border-top: 1.5px solid #e0e0e0;
    border-radius: 0 0 18px 0;
    position: sticky;
    bottom: 0;
    gap: 10px;
}
#reply-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    background: #fff;
    color: #222;
    transition: border 0.2s;
}
#reply-input:focus {
    border: 1.5px solid #bdbdbd;
}
#reply-btn {
    padding: 8px 22px;
    background: #e0e0e0;
    color: #222;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
#reply-btn:hover {
    background: #388e3c;
    color: #fff;
}
@media (max-width: 700px) {
    #container { flex-direction: column; }
    #user-list { width: 100%; border-right: none; border-bottom: 1.5px solid #e0e0e0;}
    #chat-panel { min-height: 300px; }
}