/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 聊天容器 */
.chat-container {
    width: 100%;
    max-width: 420px;
    height: 90vh;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 聊天头部 */
.chat-header {
    padding: 15px 20px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn,
.feedback-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.chat-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 广告图片展示 */
.ad-image {
    background-color: #f8f8f8;
    border-radius: 10px;
    padding: 15px;
    position: relative;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 5px;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.image-item img:hover {
    transform: scale(1.05);
}

.ad-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 153, 0, 0.9);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 1;
}

.ad-banner {
    background: linear-gradient(90deg, #ff6b6b, #ffa502);
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.ad-banner span {
    color: white;
    font-size: 12px;
    font-weight: 500;
}

/* 消息样式 */
.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-system {
    justify-content: flex-start;
}

.message-user {
    justify-content: flex-end;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
}

.message-name {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.message-text {
    background-color: #f0f0f0;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-user .message-text {
    background-color: #07c160;
    color: white;
}

/* 微信按钮样式 */
.wechat-button-container {
    text-align: center;
}

.wechat-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #21a702;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 8px;
}

.wechat-button:hover {
    background-color: #1e8e01;
}

.wechat-button img {
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 5px;
    padding: 2px;
}

.wechat-button-container p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* 输入区域 */
.chat-input-area {
    padding: 15px 20px;
    background-color: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

#chat-input:focus {
    border-color: #07c160;
}

#send-btn {
    background-color: #07c160;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

#send-btn:hover {
    background-color: #05a753;
}

#send-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 底部信息 */
.chat-footer {
    padding: 10px 20px;
    background-color: #fff;
    border-top: 1px solid #eee;
    text-align: center;
}

.chat-footer p {
    font-size: 12px;
    color: #999;
}

/* 隐藏类 */
.hidden {
    display: none;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}