/* ========== 【改这里】访客端手机自适应 ========== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  background: #fff;
}

input:focus, textarea:focus { outline: none; outline-offset: 0; }
* { outline: none; -webkit-tap-highlight-color: rgba(0,0,0,0); box-sizing: border-box; }

::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.2); border-radius: 10px; }
::-webkit-scrollbar-track { background-color: transparent; }

.content {
  position: fixed;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.contentTop {
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: 56px;
  background: linear-gradient(to right, #3366ff, purple);
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.contentTopP {
  float: none;
  margin: 0 10px 0 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.contentTopView {
  float: none;
  width: auto;
  flex: 1;
  min-width: 0;
  height: auto;
  line-height: 1.2;
  text-align: left;
  color: #fff;
}
.contentTopView1 {
  width: 100%;
  height: auto;
  line-height: 1.3;
  font-size: 15px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contentTopView2 {
  width: 100%;
  height: auto;
  margin-top: 2px;
  line-height: 1.2;
  font-size: 12px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contentView {
  width: 100%;
  height: calc(100% - 56px);
  overflow: hidden;
  display: flex;
}

/* 默认按手机全宽；宽屏再分栏 */
.part1_pc,
.part1_mb {
  position: relative;
  float: none;
  width: 100%;
  height: 100%;
  border-right: none;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.part2_pc,
.part2_mb {
  display: none;
}

.chatContent {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding-bottom: 8px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #e7e7e7;
}

.questionView {
  white-space: nowrap;
  position: static;
  width: 100%;
  height: 36px;
  background: #f8f8f8;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  border-top: 1px solid #eee;
}
.contentMiddle2_bt {
  display: inline-block;
  white-space: nowrap;
  margin: 6px 4px 0 6px;
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 14px;
  line-height: 16px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
}
.contentMiddle2_bt:active,
.contentMiddle2_bt:hover {
  box-shadow: 0 0 5px 1px rgba(255, 100, 50, 0.35);
  background: linear-gradient(to right, orange, purple);
  color: #fff;
  border-color: transparent;
}

.sendView {
  width: 100%;
  height: auto;
  min-height: 96px;
  background: #fff;
  flex-shrink: 0;
  border-top: 1px solid #eee;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.textView {
  width: 100%;
  height: 56px;
  overflow: hidden;
  text-align: center;
}
.textViewContent {
  padding: 8px 10px;
  width: 100%;
  height: 52px;
  border: none;
  resize: none;
  font-size: 16px; /* iOS 避免自动放大 */
  line-height: 1.4;
}

.sendBtnView {
  position: relative;
  width: 100%;
  height: 40px;
  background: #fff;
}
.sendText,
.sendPicture {
  position: absolute;
  bottom: 5px;
  width: 64px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
}
.sendText {
  right: 8px;
  background: linear-gradient(to right, royalblue, purple);
}
.sendPicture {
  right: 80px;
  background: linear-gradient(to right, pink, orange);
}
.sendPictureBtn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 9;
  font-size: 64px;
  touch-action: manipulation;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
}
.sendText:active,
.sendPicture:active,
.sendText:hover,
.sendPicture:hover { background: grey; }

.part2Top {
  width: 100%;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-bottom: 1px solid #ccc;
  font-size: 13px;
  font-weight: bold;
}
.part2Content {
  padding: 10px;
  height: calc(100% - 200px);
  overflow: auto;
  font-size: 14px;
  font-weight: bold;
}
.part2Bottom {
  width: 100%;
  height: 150px;
  border-top: 1px solid #ccc;
  text-align: center;
}
.part2BottomP {
  margin: 10px 0 0 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}
.part2BottomT {
  width: 100%;
  height: 40px;
  line-height: 40px;
  font-size: 14px;
  font-weight: bold;
}

.messageStyle {
  margin: 10px;
  height: auto;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}
.messageView1_left { width: auto; height: 30px; line-height: 30px; text-align: left; }
.messageView1_right { width: auto; height: 30px; line-height: 30px; text-align: right; }
.messageView1T1 { font-size: 14px; font-weight: bold; }
.messageView1T2 { margin-left: 10px; font-size: 12px; color: grey; }
.messageView2 { width: 100%; height: auto; overflow: hidden; }
.messageContent {
  padding: 10px;
  max-width: min(92%, 520px);
  min-height: 20px;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: 14px;
  background: #fff;
}
/* 【改这里】访客端已撤回样式 */
.messageRecalled{
  background: #f0f0f0 !important;
  color: #999 !important;
  font-style: italic;
}
.messagePicture {
  padding: 8px;
  max-width: min(75%, 320px);
  min-height: 20px;
  border-radius: 10px;
  background: #fff;
}
.pictureStyle {
  width: 100%;
  border-radius: 8px;
  display: block;
  cursor: zoom-in;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.chat-video {
  max-width: 240px;
  max-height: 180px;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  cursor: pointer;
  background: #000;
  pointer-events: none;
  object-fit: cover;
}
.chat-video-thumb{
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.chat-video-play{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 18px;
  pointer-events: none;
}
.chat-video-tip {
  display: none;
}
.video-preview-mask{
  display:none !important;
  position:fixed;
  inset:0;
  z-index:10000;
  background:rgba(0,0,0,0.92);
  align-items:center;
  justify-content:center;
  flex-direction:column;
  padding:16px;
}
.video-preview-mask.show{
  display:flex !important;
}
.video-preview-player{
  width:min(100%, 720px);
  max-height:75vh;
  background:#000;
  border-radius:8px;
}
.video-preview-close{
  margin-top:12px;
  border:none;
  border-radius:18px;
  padding:8px 18px;
  font-size:14px;
  color:#fff;
  background:rgba(255,127,50,0.95);
  cursor:pointer;
}

/* ################################################################
 * 【改这里】文件路径：user/css/index.css
 * 作用：图片放大预览层样式（配合 user/js/index.js）
 * 长按已禁用系统菜单，避免和短按关闭打架卡死
 * ################################################################ */
/* ========== 【改这里】图片点击放大预览 ========== */
.img-preview-mask{
  display:none !important;
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(0,0,0,0.88);
  align-items:center;
  justify-content:center;
  flex-direction:column;
  padding:16px;
  padding-top:max(16px, env(safe-area-inset-top));
  padding-bottom:max(16px, env(safe-area-inset-bottom));
  pointer-events:none;
  visibility:hidden;
  -webkit-user-select:none;
  user-select:none;
}
.img-preview-mask.show{
  display:flex !important;
  pointer-events:auto;
  visibility:visible;
}
.img-preview-toolbar{
  position:absolute;
  top:max(12px, env(safe-area-inset-top));
  right:12px;
  display:flex;
  gap:8px;
  z-index:2;
}
.img-preview-btn{
  display:inline-block;
  border:none;
  border-radius:18px;
  padding:8px 14px;
  font-size:14px;
  color:#fff;
  background:rgba(255,127,50,0.95);
  text-decoration:none;
  cursor:pointer;
  line-height:1.2;
  touch-action: manipulation;
}
#imgPreviewClose{ background:rgba(255,255,255,0.25); }
.img-preview-img{
  max-width:100%;
  max-height:78vh;
  max-height:78dvh;
  object-fit:contain;
  border-radius:8px;
  pointer-events: auto;
  /* 【改这里】禁止长按系统菜单，只用按钮保存，避免卡死 */
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  touch-action: manipulation;
}
.img-preview-tip{
  margin-top:12px;
  max-width:92%;
  font-size:13px;
  line-height:1.5;
  color:rgba(255,255,255,0.85);
  text-align:center;
}
/* ============================================ */
.fl { float: left; }
.fr { float: right; }

.bg1 { background: royalblue; color: #fff; }
.bg2 { background: red; color: #fff; }
.bg3 { background: purple; color: #fff; }
.bg4 { background: green; color: #fff; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 平板/电脑：仍单栏全宽聊天（已去掉右侧友情提示） */
@media (min-width: 768px) {
  .part1_pc,
  .part1_mb {
    width: 100%;
    border-right: none;
  }
  .part2_pc,
  .part2_mb {
    display: none !important;
  }
  .contentView { display: flex; }
  .textViewContent { font-size: 14px; }
}
