*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  background: #ffeef5; /* 淡粉背景 */
  color: #333;
}

/* 整体容器 */

.app-container {
  display: flex;
  height: 100vh;
  max-width: 1200px;
  margin: 20px auto;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(255, 105, 180, 0.25);
  overflow: hidden;
}

/* 左侧：房间卡片区 */

.sidebar {
  width: 32%;
  min-width: 280px;
  border-right: 1px solid rgba(255, 192, 203, 0.5);
  background: linear-gradient(180deg, #ffe6f0 0%, #fff8fb 60%, #ffffff 100%);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid rgba(255, 192, 203, 0.4);
}

.logo-text {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #ff4081;
}

.subtitle {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: #b56e8b;
}

.room-list {
  flex: 1;
  padding: 12px 16px 16px 16px;
  overflow-y: auto;
}

/* 房间卡片 */

.room-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 25px rgba(255, 105, 180, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.room-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 105, 180, 0.22);
  background: #ffffff;
}

.room-card.active {
  border: 1px solid #ff6fa5;
  box-shadow: 0 16px 36px rgba(255, 64, 129, 0.28);
}

.room-thumb {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
}

.room-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.room-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #ff4081;
}

.room-desc {
  margin: 0;
  font-size: 12px;
  color: #8a6b7a;
}

/* 右侧主面板 */

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top left, #ffeaf6 0, #ffffff 40%);
}

/* 房间详情（右上） */

.room-detail {
  display: flex;
  padding: 18px 22px 14px 22px;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 192, 203, 0.4);
}

.room-detail-image-wrapper {
  width: 180px;
  min-width: 160px;
  height: 110px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(255, 105, 180, 0.32);
}

.room-detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.room-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: #ff4081;
  margin: 0 0 4px 0;
}

.room-detail-desc {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #8a6b7a;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.room-meta-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 192, 203, 0.25);
  color: #c0487a;
}

.room-price {
  font-size: 14px;
  font-weight: 600;
  color: #e91e63;
}

/* 聊天面板（右下） */

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px 16px;
}

.chat-messages {
  flex: 1;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 245, 250, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 192, 203, 0.35);
  overflow-y: auto;
}

/* 消息气泡 */

.message-row {
  display: flex;
  margin-bottom: 8px;
}

.message-row.me {
  justify-content: flex-end;
}

.message-row.other {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.4;
}

.message-row.other .message-bubble {
  background: #ffffff;
  color: #555;
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 10px rgba(255, 105, 180, 0.15);
}

.message-row.me .message-bubble {
  background: linear-gradient(135deg, #ff6fa5, #ff4081);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(255, 64, 129, 0.35);
}

/* 输入栏 */

.chat-input-bar {
  display: flex;
  margin-top: 10px;
  gap: 10px;
}

#chatInput {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 192, 203, 0.9);
  outline: none;
  font-size: 13px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(255, 182, 193, 0.35);
}

#chatInput:focus {
  border-color: #ff6fa5;
  box-shadow: 0 0 0 2px rgba(255, 111, 165, 0.25);
}

#sendBtn {
  padding: 0 20px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ff6fa5, #ff4081);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 64, 129, 0.45);
  transition: transform 0.1s ease, box-shadow 0.1s ease,
    filter 0.1s ease;
}

#sendBtn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 10px 22px rgba(255, 64, 129, 0.52);
}

#sendBtn:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(255, 64, 129, 0.35);
}

/* 响应式 */

@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 192, 203, 0.5);
  }

  .main-panel {
    min-height: 70vh;
  }

  .room-detail {
    flex-direction: column;
    align-items: center;
  }

  .room-detail-image-wrapper {
    width: 100%;
    max-width: 260px;
  }

  .room-detail-info {
    align-items: flex-start;
    width: 100%;
  }
}