/* ===========================================================
   diewan.com 反馈聊天室样式 (chat.css)
   同时服务 PC（default）与移动端（mobile），响应式自适应。
   颜色变量与站点 pc_style.css / m_style.css 的 --brand-* 保持一致。
   =========================================================== */
:root {
  --chat-brand: #00a68f;
  --chat-brand-2: #00dcc0;
  --chat-bg: #f5f7f9;
  --chat-card: #ffffff;
  --chat-bubble-self: linear-gradient(135deg, #00dcc0, #00a68f);
  --chat-bubble-other: #eef1f4;
  --chat-text: #1f2933;
  --chat-muted: #8a94a6;
  --chat-border: #e6eaef;
}

.chat-room {
  max-width: 880px;
  margin: 24px auto 40px;
  background: var(--chat-card);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(20, 40, 60, 0.06);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 460px;
  overflow: hidden;
}
.chat-room__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--chat-border);
  background: linear-gradient(135deg, rgba(0,220,192,0.10), rgba(0,166,143,0.06));
}
.chat-room__head .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #2ecc71; box-shadow: 0 0 0 3px rgba(46,204,113,0.18);
}
.chat-room__head h2 {
  font-size: 16px; margin: 0; color: var(--chat-text);
}
.chat-room__head .sub {
  font-size: 12px; color: var(--chat-muted); margin-left: auto;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  background: var(--chat-bg);
  scroll-behavior: smooth;
}
.chat-empty {
  text-align: center;
  color: var(--chat-muted);
  font-size: 13px;
  margin-top: 40px;
}
.msg {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  max-width: 78%;
}
.msg--self { align-self: flex-end; align-items: flex-end; }
.msg--other { align-self: flex-start; align-items: flex-start; }
.msg__meta {
  font-size: 12px; color: var(--chat-muted);
  margin: 0 4px 4px;
  display: flex; gap: 8px; align-items: center;
}
.msg__name { font-weight: 600; color: #54616f; }
.msg__time { color: var(--chat-muted); }
.msg__bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--chat-text);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg--other .msg__bubble {
  background: var(--chat-bubble-other);
  border-bottom-left-radius: 4px;
}
.msg--self .msg__bubble {
  background: var(--chat-bubble-self);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg--self .msg__name { display: none; }

.chat-foot {
  border-top: 1px solid var(--chat-border);
  background: var(--chat-card);
  padding: 12px 16px;
}
.chat-foot__nick {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--chat-muted);
  margin-bottom: 8px;
}
.chat-foot__nick input {
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  width: 160px;
  color: var(--chat-text);
  outline: none;
}
.chat-foot__nick input:focus { border-color: var(--chat-brand); }
.chat-foot__nick .me { color: var(--chat-brand); font-weight: 600; }
.chat-foot__row {
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-foot__row textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--chat-text);
  outline: none;
  max-height: 120px;
  font-family: inherit;
}
.chat-foot__row textarea:focus { border-color: var(--chat-brand); }
.chat-foot__send {
  border: none;
  background: linear-gradient(135deg, var(--chat-brand-2), var(--chat-brand));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 0 22px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  flex: none;
  transition: opacity .15s;
}
.chat-foot__send:disabled { opacity: .55; cursor: not-allowed; }
.chat-foot__tip {
  font-size: 11px; color: var(--chat-muted); margin-top: 6px;
}
.chat-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: rgba(31,41,51,0.92); color: #fff; padding: 9px 18px;
  border-radius: 20px; font-size: 13px; z-index: 9999;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.chat-toast.show { opacity: 1; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 768px) {
  .chat-room {
    margin: 12px 10px 24px;
    border-radius: 12px;
    height: calc(100vh - 180px);
    min-height: 360px;
  }
  .chat-room__head { padding: 12px 14px; }
  .chat-room__head h2 { font-size: 15px; }
  .chat-room__head .sub { display: none; }
  .chat-body { padding: 14px; }
  .msg { max-width: 86%; }
  .chat-foot { padding: 10px 12px; }
  .chat-foot__nick input { width: 120px; }
  .chat-foot__send { padding: 0 16px; }
}
