/* ==========================================
聊天模块样式 (chat.css)
========================================== */

/* 未读提示红点 */
.chat-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: var(--piece-dvonn);
    border-radius: 50%;
    display: none;
  }
  
  .chat-badge.active {
    display: block;
  }
  
  /* 聊天面板整体浮层，定位在底部栏上方 */
  .chat-container {
    position: fixed;
    bottom: 74px; /* 位于底部工具栏上方 */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 92%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99;
  }
  
  .chat-container.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
  
  /* 消息列表区 */
  .chat-messages {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px;
    scrollbar-width: none;
  }
  
  .chat-messages::-webkit-scrollbar {
    display: none;
  }
  
  /* 消息气泡 */
  .chat-msg {
    max-width: 80%;
    padding: 7px 12px;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 14px;
    word-break: break-word;
    animation: fadeInMsg 0.2s ease forwards;
  }
  
  @keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .chat-msg.self {
    align-self: flex-end;
    background: var(--card-bg);
    color: var(--text);
    border-bottom-right-radius: 3px;
  }
  
  .chat-msg.peer {
    align-self: flex-start;
    background: var(--card-bg);
    color: var(--text);
    border-bottom-left-radius: 3px;
  }
  
  .chat-msg.system {
    align-self: center;
    font-size: 11px;
    color: var(--text-muted, #888);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 10px;
  }
  
  /* 下方无边框白色底输入栏 */
  .chat-input-bar {
    display: flex;
    align-items: center;
    background: #ffffff;      /* 纯白底色 */
    border: none;             /* 无边框 */
    outline: none;
    border-radius: 24px;
    padding: 4px 6px 4px 16px;
  }
  
  /* 输入框本体 */
  .chat-input-field {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #2f3542;
    padding: 8px 0;
  }
  
  .chat-input-field::placeholder {
    color: #a4b0be;
  }
  
  /* 发送按钮 */
  .chat-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
  }
  
  .chat-send-btn svg {
    width: 14px;
    height: 14px;
    stroke: var(--text);
    stroke-width: 2.5;
    fill: none;
    margin-left: -1px;
  }
  
  .chat-send-btn:active {
    transform: scale(0.9);
  }