/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;      /* 确保最小高度为屏幕高度 */
  width: 100%;            /* 宽度占满屏幕 */
  margin: 0;              /* 清除默认外边距（已通过 * 重置，此处为冗余保险） */
  padding: 20px;          /* 可选：添加内边距避免内容贴边 */
  overflow-y: auto;       /* 允许垂直滚动（内容溢出时自动显示滚动条） */
}


/* 聊天容器 */
.chat-container {
  width: 100%;                   /* 占满 body 的可用宽度（扣除 padding） */
  height: calc(100vh - 40px);     /* 100vh 减去 body 的上下 padding 总和（20px*2） */
  background: #f5f5f5;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

/* 聊天头部 */
.chat-header {
    padding: 15px;
    background: #1E90FF;
    color: white;
    border-radius: 10px 10px 0 0;
}

/* 服务信息容器 */
.service-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    padding-bottom: 15px;
}

/* 头像基本样式 */
.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #eee;
    flex-shrink: 0;
}

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

/* 聊天息区域 */
.chat-messages {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

/* 消息基本样式 */
.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    position: relative;
    width: 100%;
    padding: 0;
}

/* 用户消息样式 */
.message.user {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    padding-left: 40px;
}

/* 客服消息样式 */
.message.service {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding-right: 40px;
}

/* 消息内容样式 */
.message-content {
    padding: 8px 12px;
    padding-bottom: 20px;
    border-radius: 12px;
    position: relative;
    word-break: break-all;
    white-space: pre-line;
    width: fit-content;
    min-width: 60px;
    max-width: 70%;
    line-height: 1.5;
    font-size: 14px;
}

/* 图片样式 */
.message-content img {
    max-width: 100%; /* 图片最大宽度为父容器的宽度 */
    height: auto; /* 高度自动调整，保持宽高比例 */
    border-radius: 8px; /* 可选：为图片添加圆角 */
    display: block; /* 防止图片下方出现空白间隙 */
}

/* 用户消息内容样式 */
.message.user .message-content {
    background: white;
    color: #333;
    border: 1px solid #e6e6e6;
    margin-right: 8px;
    order: 0;
}

/* 客服消息内容样式 */
.message.service .message-content {
    background: #1E90FF;
    color: white;
    margin-left: 8px;
}

/* 时间戳样式 */
.message-time {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.message.user .message-time {
    color: #999;
}

.message.service .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* 输入区域样式 */
.chat-input {
    padding: 10px 15px;
    border-top: 1px solid #e6e6e6;
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f5f5f5;
    position: relative;
}

textarea {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    resize: none;
    height: 36px;
    font-size: 14px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.send-button {
    background: #1E90FF;
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 4px;
    cursor: pointer;
    height: 36px;
}

/* 更多按钮样式 */
.more-button {
    font-size: 18px;
    color: #666;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    cursor: pointer;
    position: relative;
}

.more-button:hover {
    background-color: #f0f0f0;
}

/* 更多功能菜单样式 */
.more-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    padding: 8px;
    z-index: 1000;
    margin-bottom: 8px;
}

/* 显示菜单时的样式 */
.more-menu.show {
    display: block;
}

/* 菜单项样式 */
.menu-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

/* 菜单图标样式 */
.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* 隐藏文件输入框 */
#imageInput {
    display: none;
}

/* 头部头像样式 */
.chat-header .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid white;
    overflow: hidden;
    margin-bottom: 5px;
    margin: 0 auto 5px;
}

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

/* 头部信息文字样式 */
.info {
    text-align: center;
    width: 100%;
}

.service-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    text-align: center;
}

.service-id {
    font-size: 14px;
    opacity: 0.9;
    text-align: center;
}

/* 用户头像样式 */
.message.user .avatar {
    order: 1;
    margin-left: 0;
}

/* 评分消息样式 */
.rating-message {
    padding: 12px;
}

.rating-stars {
    margin: 10px 0;
    font-size: 24px;
    display: flex;
    gap: 8px;
}

.star {
    cursor: pointer;
    color: #ffb3b3;  /* 浅红色，未选中状态 */
    transition: color 0.2s;
}

.star:hover {
    color: #ff0000;  /* 鲜红色，悬停状态 */
}

.star.selected {
    color: #ff0000;  /* 鲜红色，选中状态 */
}

.rating-text {
    font-size: 12px;
    color: white;
    margin-top: 5px;
}

/* 订单弹窗样式 */
.order-modal {
    display: none;
    position: fixed;  /* 改为固定定位 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.order-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 300px;
    max-height: 400px;
    margin: auto;
}

.modal-header {
    padding: 10px;    /* 减小内边距 */
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 15px;  /* 减小字体大小 */
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.modal-body {
    padding: 10px;    /* 减小内边距 */
    overflow-y: auto;
    max-height: 350px; /* 限制内容区最大高度 */
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;         /* 减小间距 */
}

.order-item {
    padding: 10px;  /* 减小内边距 */
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    margin-bottom: 6px;  /* 减小订单项之间的间距 */
}

.order-item:hover {
    background-color: #f5f5f5;
}

.more-orders {
    text-align: center;
    padding: 10px 0;
}

.more-orders-btn {
    background: #1E90FF;  /* 蓝色背景 */
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.more-orders-btn:hover {
    background: #187bcd;
}

/* 订单号样式 */
.order-id {
    color: #006400;
    font-weight: bold;
    margin-bottom: 6px;  /* 减小与订单信息的间距 */
    font-size: 13px;    /* 减小订单号字体大小 */
}

/* 订单状态标签样式 */
.status-tag {
    display: inline-block;
    padding: 1px 8px;   /* 减小内边距 */
    border-radius: 10px;
    font-size: 11px;    /* 减小状态标签字体大小 */
    color: white;
    margin-left: 4px;
}

/* 不态的颜色 */
.status-tag.completed {
    background-color: #999;  /* 已结束-灰色 */
}

.status-tag.in-progress {
    background-color: #1E90FF;  /* 已出行-色 */
}

.status-tag.waiting {
    background-color: #07C160;  /* 待服务-绿色 */
}

/* 订单信息样式 */
.order-info {
    font-size: 12px;    /* 减小订单信息字体大小 */
    color: #333;
    line-height: 1.4;   /* 减小行高 */
}

.order-info > div {
    margin-bottom: 3px; /* 减小信息项之间的间距 */
}

/* 选择按钮样式 */
.select-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: #1E90FF;
    color: white;
    border: none;
    padding: 2px 10px;  /* 减小按钮内边距 */
    border-radius: 10px;
    font-size: 11px;    /* 减小按钮字体大小 */
    cursor: pointer;
    transition: background-color 0.2s;
}

.select-btn:hover {
    background: #187bcd;
}

/* 手机号码输入消息样式 */
.phone-input-container {
    position: relative;
    display: flex;
    margin-top: 8px;
    margin-bottom: 8px;
}

.phone-input {
    width: 100%;
    padding: 6px 80px 6px 12px;  /* 减小边距，右侧留出更小的按钮空间 */
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;    /* 减小输入框字体 */
    outline: none;
    background: white;
    height: 32px;      /* 减小输入框度 */
}

.phone-input::placeholder {
    font-size: 12px;   /* 减小占位符字体 */
}

.phone-submit-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: #1E90FF;
    color: white;
    border: none;
    padding: 3px 12px;  /* 减小按钮内边距 */
    border-radius: 15px;
    cursor: pointer;
    font-size: 11px;    /* 减小按钮字体 */
    height: 24px;       /* 减小按钮高度 */
    line-height: 18px;  /* 调整文字垂直居中 */
}

.phone-submit-btn:hover {
    background: #187bcd;
}

.phone-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 禁用状态的输入框样式 */
.phone-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    font-size: 12px;
}

/* 修改工单按钮样式 */
.ticket-btn {
    position: absolute;
    right: 15px;
    bottom: 10px;
    background: white;
    color: #1E90FF;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    z-index: 10;
}

.ticket-icon {
    font-size: 14px;   /* 图标大小 */
}

.ticket-text {
    font-weight: 500;  /* 文字加粗 */
}

.ticket-btn:hover {
    background: #f0f0f0;
}

/* 工单弹窗样式 */
.ticket-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.ticket-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ticket-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 300px;
    padding: 15px;
}

.ticket-modal-header {
    display: flex;
    justify-content: center;  /* 居中标题 */
    align-items: center;
    margin-bottom: 15px;
    position: relative;  /* 为关闭按钮定位 */
    padding: 10px 0;    /* 添加上下内边距 */
    border-bottom: 1px solid #eee;
}

.ticket-modal-header h3 {
    margin: 0;
    font-size: 15px;
    color: #333;
    flex: 1;          /* 占据剩余空间 */
    text-align: center; /* 文字居中 */
}

.close-ticket-modal {
    position: absolute; /* 绝对定位 */
    right: 10px;       /* 靠右显示 */
    top: 50%;          /* 垂直居中 */
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

/* 聊天图片样式 */
.chat-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin: 5px 0;
    display: block;
    cursor: pointer;
}

/* 隐藏文件输入框 */
#imageInput {
    display: none;
}

/* 反馈表单样式 */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 13px;
    color: #1E90FF;  /* 改为蓝色 */
    font-weight: 500;  /* 加粗显示 */
}

.form-group input,
.form-group textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.fixed-text {
  width: 100%;                /* 宽度限制 */
  max-width: 600px;            /* 可选：限制最大宽度 */
  white-space: pre-wrap;       /* 保留换行符，允许自动换行 */
  word-break: break-all;       /* 强制任意字符断行 */
  overflow-wrap: break-word;   /* 优先在单词内换行（兼容性备用） */
  padding: 8px;                /* 保持与原输入框样式一致 */
  border: 1px solid #ddd;      /* 模拟输入框边框 */
  background-color: #f9f9f9;   /* 模拟输入框背景色 */
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-btn {
    background: #1E90FF;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 8px;
}

.submit-btn:hover {
    background: #187bcd;
}

/* 评分弹窗样式 */
.rating-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.rating-modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 300px;
    text-align: center;
}

.rating-modal-header {
    margin-bottom: 15px;
}

.rating-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.rating-modal-body p {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.rating-stars {
    margin: 20px 0;
    font-size: 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.rating-text {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* 评分项样式 */
.rating-item {
    margin: 10px 0;
    text-align: left;
}

.rating-stars-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-stars {
    display: flex;
    gap: 4px;
}

.rating-text {
    font-size: 12px;
    color: #666;
    display: inline-block;
    margin-left: 10px;
}

/* 评分反馈框样式 */
.rating-feedback {
    margin: 15px 0;
}

.rating-feedback textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    min-height: 100px;  /* 增加文本框高度 */
    line-height: 1.5;   /* 优化行高 */
}

/* 评分提交按钮样式 */
.rating-submit-btn {
    background: #1E90FF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: all 0.2s;
}

.rating-submit-btn:hover {
    background: #187bcd;
}

/* 移除未评分文本 */
.rating-text {
    display: none;
}

/* 评分文本样式 */
.rating-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    display: none;  /* 默认隐藏 */
}

/* 显示评分文本时的样式 */
.rating-text.show {
    display: block;
}

/* 视频样式 */
video {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

/* 音频样式 */
audio {
    width: 100%;
    margin-top: 10px;
}