/* ========================================= */
/* 文件：chat-view.css                        */
/* 功能：聊天页面的容器框架 —— 四角打钉的    */
/*       聊天视图、顶部导航栏与返回按钮、      */
/*       iOS输入法弹出时的兼容修复             */
/* ========================================= */

/* ============ ✨✨✨ 1. 聊天界面 (Chat View) ✨✨✨ ============ */
#view-chat {
  display: flex; 
  flex-direction: column;
  width: 100%;
  
  /* ✨ 核心回滚 1：坚决删掉 height: 100dvh！绝不让它埋进键盘里！ */
  
  /* ✨ 核心回滚 2：用 fixed 和上下左右打钉法，让 iOS 自动把底边推到键盘上方！ */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  
  z-index: 10;
  overflow: hidden; /* 锁死弹性盒子边界，不让孩子撑爆容器 */

  /* 背景保持大王喜欢的挂顶锚定 */
  background: linear-gradient(rgba(11,15,26,0.35), rgba(11,15,26,0.35)), var(--chat-bg-url) no-repeat top center;
  background-size: cover;
}
.header {
  padding-top: max(10px, calc(env(safe-area-inset-top) - 10px));
  padding-bottom: 6px;
  text-align: center;
  background: transparent;
  z-index: 10;
  position: relative;
  flex-shrink: 0;
}

.header-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  padding-top: 20px; 
}

.header-status {
  font-size: 10px;
  font-weight: 400;
  color: #badc58;
  opacity: 0.9;
  margin-top: 5px; 
  letter-spacing: 0.5px;
}

/* 按钮组 */
.icon-btn {
  width: 40px; 
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn img { width: 24px; height: 24px; filter: invert(1); }

.btn-group-left {
  position: absolute; left: 4px; top: 0; height: 100%;
  padding-top: max(10px, calc(env(safe-area-inset-top) - 10px));
  display: flex; gap: 0; z-index: 20;
}

.btn-left { 
  position: absolute; left: 4px; top: 0;
  padding-top: max(40px, calc(env(safe-area-inset-top) - 10px)); 
}

.btn-right { 
  position: absolute; right: 4px; top: 0;
  padding-top: max(40px, calc(env(safe-area-inset-top) - 10px)); 
}
/* iOS PWA 输入法修复（仅限聊天输入区） */
#view-chat .input-area,
#view-chat .input-area * {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
