* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #ededed;
    overflow-x: hidden;
}

.chat-container {
    max-width: 400px;
    margin: 0 auto;
    background: #f5f5f5;
    height: 100vh;
    position: relative;
}

/* VIP横幅 */
.vip-banner {
    background: linear-gradient(90deg, #ffa726, #ff9800);
    padding: 8px 12px;
    display: flex;
    align-items: flex-start;
    font-size: 12px;
    color: white;
}

.vip-content {
    display: flex;
    flex-direction: column;
    flex: 1; font-weight: 500;
    font-size: 14px;
}

.vip-top-line {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.vip-service-text {
    font-size: 12px;
    line-height: 1.3;
    opacity: 0.9;
}

.vip-icon {
    /*background: #4caf50;*/
    color: white;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 18px;
    flex-shrink: 0;
}
.vip-icon img{
    border-radius: 50%;
}

.vip-badge {
    background: rgba(255,255,255,0.3);
    padding: 0px 6px;
    border-radius: 3px;
    margin-right: 8px;
    font-size: 14px;
    line-height: 1.3;
}

/* 系统通知 */
.system-notice {
    background: #ffdccd;
    padding: 4px 15px;
    position: absolute;
    width: 100%;
    margin-top:5px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    z-index: 10;
}
.scrolling-text-container {
    flex: 1;
    overflow: hidden;
    /*transform: translateX(100%);*/
    /*width: 300px;*/
    position: relative;
}
.system-notice.hidden {
    display: none;
}
.notice-tag {
    font-size: 12px;
    margin-right: 10px;
    border: 1px solid #666;
    padding: 2px 8px;
    border-radius: 15px;
    line-height: 1;
    flex-shrink: 0;
}
.scrolling-text {
    display: inline-block;
    animation: scrollLeft 20s linear infinite;
}
@keyframes scrollLeft {
    0% {
        transform: translateX(50%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.notice-text {
    color: #e91e63;
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.notice-icon {
    margin-right: 5px;
    font-size: 14px;
    flex-shrink: 0;
}

.notice-close {
    background: #666;
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}

.notice-time {
    font-size: 11px;
    color: #999;
    text-align: center;
    padding: 5px 0;
}

/* 聊天区域 */
.chat-messages {
    padding: 10px;
    height: calc(100vh - 260px);
    overflow-y: auto;
    background: #f5f5f5;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.message.sent {
    flex-direction: row-reverse;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 5px;
    /*background: linear-gradient(45deg, #ffd54f, #ffb74d);*/
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.avatar img {
    width: 35px;
    height: 35px;
    border-radius: 5px;
}

.message-content {
    max-width: 70%;
    margin: 0 8px;
}

.message.sent .message-content {
    text-align: right;
}

.sender-info {
    font-size: 11px;
    color: #999;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
}

.message.sent .sender-info {
    justify-content: flex-end;
}

.vip-label {
    background: #ff9800;
    color: white;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 9px;
    margin-right: 5px;
}

.message.sent .vip-label {
    margin-right: 0;
    margin-left: 5px;
}

.timestamp {
    font-size: 10px;
    color: #999;
}

.bubble {
    display: inline-block;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    max-width: 100%;      /* 防止内容超出父级 */
    word-break: break-word; /* 长单词换行 */
}

.message.sent .bubble {
    background: #4fc3f7;
    color: white;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -5px;
    width: 0;
    height: 0;
    border: 5px solid transparent;
    border-right-color: white;
}

.message.sent .bubble::before {
    left: auto;
    right: -5px;
    border-right-color: transparent;
    border-left-color: #4fc3f7;
}

.message-time {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

.message.sent .message-time {
    text-align: right;
    color: rgba(255,255,255,0.8);
}

.image-placeholder {
    width: 150px;
    height: 100px;
    background: #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

/* 输入区域 */
.input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f7f7f7;
    border-top: 1px solid #d9d9d9;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* 文本输入框区域 */
.text-input-section {
    padding: 8px 15px;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-input {
    flex: 1;
    border: none;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 16px;
    outline: none;
    background: #fafafa;
    color: #999;
    /*min-height: 108px;*/
    line-height: 3;
    resize: none;
    overflow-y: hidden;
}

.message-input:focus {
    background: white;
    color: #333;
}

.send-button {
    background: #ededed;
    color: #999;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    align-self: center;
}

.send-button:hover {
    background: #07c160;
    color: white;
}

/* 底部工具栏 */
.bottom-toolbar {
    background: white;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
}

.toolbar-left {
    display: flex;
    align-items: center;
}

.toolbar-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.toolbar-icon:hover {
    color: #333;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.toolbar-text {
    font-size: 15px;
    color: #576b95;
    font-weight: 500;
    cursor: pointer;
}

.toolbar-text:hover {
    color: #485a75;
}

/* 响应式 */
@media (max-width: 480px) {
    .chat-container {
        max-width: 100%;
    }
}