/* 输入栏 + 表情面板 */
.chat-input-wrap {
  flex-shrink: 0;
  background: #fff;
  border-top: none;
  box-shadow: none;
}

.chat-input-wrap.panel-open {
  background: #fff;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

.chat-input-area textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: none;
  border-radius: 8px;
  background: #f2f4f7;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.45;
  min-height: 36px;
  max-height: 96px;
  outline: none;
  overflow-y: auto;
  overflow-x: hidden;
  color: #1a2332;
  -webkit-appearance: none;
  appearance: none;
  scrollbar-width: none;
  box-shadow: none;
}

.chat-input-area textarea::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.chat-input-area textarea:focus {
  background: #eef0f3;
  border: none;
  box-shadow: none;
  outline: none;
}

.chat-input-area textarea::placeholder {
  color: #a0aab4;
}

.emoji-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #7a8490;
  transition: color 0.15s, background 0.15s;
}

.emoji-btn:hover {
  color: #3b6fd9;
  background: #f2f4f7;
}

.emoji-btn.active {
  color: #3b6fd9;
  background: #eef3fc;
}

.emoji-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.emoji-btn .icon-keyboard {
  display: none;
}

.emoji-btn.active .icon-emoji {
  display: none;
}

.emoji-btn.active .icon-keyboard {
  display: block;
}

.send-btn {
  flex-shrink: 0;
  height: 34px;
  min-width: 48px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: #e4e8ed;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.send-btn.active {
  background: #3b6fd9;
  box-shadow: none;
}

.send-btn.active:hover {
  background: #2f5eb8;
}

.send-btn.active:active {
  transform: none;
}

.send-btn:disabled {
  cursor: default;
}

.emoji-picker {
  display: none;
  border-top: none;
  background: #fff;
  padding: 0 12px 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

.emoji-picker.open {
  display: block;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  background: #f7f8fa;
  border-radius: 8px;
  border: none;
  box-shadow: none;
  scrollbar-width: none;
}

.emoji-grid::-webkit-scrollbar {
  display: none;
}

.emoji-item {
  border: none;
  background: none;
  font-size: 23px;
  line-height: 36px;
  height: 36px;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
}

.emoji-item:hover {
  background: #fff;
}

.emoji-item:active {
  background: #e8ecf1;
}

@media (max-width: 480px) {
  .emoji-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .chat-input-area textarea {
    font-size: 16px;
  }
}
