/* layout.css — PC三栏 / 平板双栏 / 手机单栏响应式 */

/* ---- 整体容器 ---- */
#app {
  display: flex; height: 100dvh; width: 100%;
  overflow: hidden;
}

/* ---- 左侧导航栏（图标菜单）---- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--c-bg);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 4px;
  border-right: 1px solid var(--c-border);
}
.sidebar-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; margin-bottom: 12px;
}
.nav-btn {
  width: 44px; height: 44px; border-radius: 10px;
  background: transparent; color: var(--c-text2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; position: relative; transition: background var(--trans);
}
.nav-btn:hover, .nav-btn.active { background: var(--c-bg3); color: var(--c-text); }
.nav-btn .badge { position: absolute; top: 4px; right: 4px; }
.sidebar-spacer { flex: 1; }
.sidebar-avatar { margin-bottom: 6px; cursor: pointer; }

/* ---- 会话列表面板 ---- */
.rooms-panel {
  width: var(--rooms-w); flex-shrink: 0;
  background: var(--c-bg2);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--c-border);
}
.rooms-header {
  padding: 14px 16px 10px; display: flex; align-items: center; gap: 8px;
}
.rooms-header h2 { font-size: 16px; flex: 1; }
.rooms-search {
  margin: 0 12px 10px; position: relative;
}
.rooms-search input {
  background: var(--c-bg4); border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 7px 10px 7px 34px;
  width: 100%; color: var(--c-text);
}
.rooms-search::before {
  content: '🔍'; position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); font-size: 14px;
}
.rooms-list { flex: 1; overflow-y: auto; }
.room-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background var(--trans); position: relative;
}
.room-item:hover { background: var(--c-bg3); }
.room-item.active { background: var(--c-bg4); }
.room-meta { flex: 1; min-width: 0; }
.room-meta .room-name { font-weight: 600; font-size: 14px; }
.room-meta .room-preview { color: var(--c-text2); font-size: 12px; margin-top: 2px; }
.room-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.room-time { font-size: 11px; color: var(--c-text3); }

/* ---- 主聊天区 ---- */
.chat-area {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: var(--c-bg3);
}
.chat-header {
  padding: 12px 18px; background: var(--c-bg2);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 10px;
}
.chat-header .room-title { font-weight: 700; font-size: 16px; flex: 1; }
.chat-header .room-members-count { color: var(--c-text2); font-size: 13px; }
.chat-header .header-actions { display: flex; gap: 6px; }

.chat-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; color: var(--c-text3);
}
.chat-empty .logo-big {
  width: 72px; height: 72px; border-radius: 16px;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 32px;
}

/* ---- 平板 (768-1023px) ---- */
@media (max-width: 1023px) {
  .sidebar { width: 56px; }
  .rooms-panel { width: 240px; }
}

/* ---- 手机 (<768px) ---- */
@media (max-width: 767px) {
  .sidebar { display: none; }
  .rooms-panel {
    width: 100%; border-right: none;
    transform: translateX(0); transition: transform .25s ease;
  }
  .rooms-panel.slide-out { transform: translateX(-100%); }
  .chat-area {
    position: absolute; inset: 0; z-index: 10;
    transform: translateX(100%); transition: transform .25s ease;
  }
  .chat-area.slide-in { transform: translateX(0); }
  .chat-header .back-btn { display: flex !important; }
  .mobile-bottom-bar {
    display: flex !important;
  }
}
.back-btn {
  display: none; background: transparent; color: var(--c-text);
  font-size: 20px; padding: 4px 8px;
}

/* ---- 登录页 ---- */
.login-page {
  min-height: 100dvh; display: flex; align-items: center;
  justify-content: center; background: var(--c-bg);
}
.login-card {
  background: var(--c-bg2); border-radius: var(--radius);
  padding: 36px; width: 360px; max-width: 92vw;
  box-shadow: var(--shadow);
}
.login-card .logo { text-align: center; margin-bottom: 24px; }
.login-card .logo-mark {
  width: 60px; height: 60px; border-radius: 14px;
  background: var(--c-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; margin-bottom: 8px;
}
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.login-card .subtitle { color: var(--c-text2); text-align: center; font-size: 13px; margin-bottom: 24px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--c-text2); }
.form-tabs { display: flex; gap: 0; margin-bottom: 20px; border-radius: var(--radius-sm); overflow: hidden; }
.form-tab {
  flex: 1; padding: 9px; text-align: center;
  background: var(--c-bg4); color: var(--c-text2); cursor: pointer;
  transition: all var(--trans);
}
.form-tab.active { background: var(--c-primary); color: #fff; }
