/* =========================================================
   温馨小窝 · 全局样式
   主题：奶油暖色系
   扩展点：后续想换主题，只需调整 :root 中的 CSS 变量
   ========================================================= */
:root {
  --bg: #fff7ec;
  --bg-soft: #fdf0dd;
  --card: #ffffff;
  --primary: #ef8f3f;
  --primary-deep: #d97728;
  --primary-soft: #fdeeda;
  --ink: #46372a;
  --ink-soft: #9b826b;
  --line: #f1e3cf;
  --green: #58b368;
  --danger: #d95d5d;
  --shadow: 0 10px 30px rgba(196, 137, 76, 0.16);
  --radius: 18px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
    -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, #ffe9c9 0%, transparent 60%),
    radial-gradient(900px 420px at -10% 110%, #ffe3c2 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #e7d5bd;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #d9c2a5;
}

/* ---------- 登录 / 注册 ---------- */
.view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 34px 30px 26px;
  text-align: center;
}

.brand-icon {
  font-size: 54px;
  line-height: 1;
}

.brand h1 {
  margin: 8px 0 4px;
  font-size: 26px;
}

.brand p {
  color: var(--ink-soft);
  margin: 0 0 22px;
  font-size: 14px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 20px;
}

.auth-tabs .tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
}

.auth-tabs .tab.active {
  background: #fff;
  color: var(--primary-deep);
  box-shadow: 0 2px 8px rgba(196, 137, 76, 0.18);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
  outline: none;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s;
}

.auth-form input:focus {
  border-color: var(--primary);
}

.auth-error {
  background: #fdecec;
  color: var(--danger);
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 14px;
  font-size: 13px;
}

.auth-hint {
  color: var(--ink-soft);
  font-size: 12.5px;
  margin: 18px 0 0;
}

/* ---------- 通用按钮 ---------- */
.btn-primary {
  border: 0;
  background: linear-gradient(135deg, #ffb066, var(--primary-deep));
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(233, 143, 63, 0.32);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(233, 143, 63, 0.38);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  background: var(--bg-soft);
  border-color: #e3cbaa;
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  transition: background 0.15s, transform 0.15s;
}

.icon-btn:hover {
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.sidebar-footer .icon-btn {
  position: relative;
}

#private-unread-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  margin: 0;
}

/* 添加好友弹窗 */
.friend-search-row {
  display: flex;
  gap: 8px;
  margin: 16px 0 10px;
}

.friend-search-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s;
}

.friend-search-row input:focus {
  border-color: var(--primary);
}

.friend-search-row .btn-primary {
  padding: 10px 16px;
}

.friend-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
}

.friend-search-item .btn-primary,
.friend-search-item .btn-ghost {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ---------- 聊天室布局 ---------- */
.chat-layout {
  display: flex;
  width: min(1180px, 100%);
  height: min(86vh, 820px);
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #fff8ec, #fdf1df);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 10px;
}

.room-name {
  font-weight: 800;
  font-size: 16px;
}

.online-count {
  font-size: 12px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.user-list-title {
  padding: 8px 16px 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* 侧边栏标签 */
.sidebar-tabs {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}

.sidebar-tabs .tab {
  flex: 1;
  border: 0;
  background: rgba(255, 255, 255, 0.65);
  padding: 8px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
}

.sidebar-tabs .tab.active {
  background: #fff;
  color: var(--primary-deep);
  box-shadow: 0 2px 8px rgba(196, 137, 76, 0.18);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: 1px;
}

.side-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.add-friend-btn {
  margin: 4px 12px 8px;
  border: 1.5px dashed var(--primary);
  background: #fff;
  color: var(--primary-deep);
  padding: 9px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.15s;
}

.add-friend-btn:hover {
  background: var(--primary-soft);
}

.friend-requests {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  max-height: 40%;
  overflow-y: auto;
  flex-shrink: 0;
}

.request-list {
  padding: 4px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friend-request-item,
.friend-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.req-info {
  flex: 1;
  min-width: 0;
}

.req-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.req-sub {
  font-size: 12px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.req-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.req-actions .btn-primary,
.req-actions .btn-ghost {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.friend-remove {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  padding: 4px;
  border-radius: 8px;
  opacity: 0;
  transition: all 0.15s;
}

.user-item:hover .friend-remove {
  opacity: 1;
}

.friend-remove:hover {
  background: #fdecec;
  color: var(--danger);
}

.list-empty {
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
  padding: 22px 12px;
}

.user-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 12px;
}

.user-item:hover {
  background: rgba(255, 255, 255, 0.75);
}

.user-item .uname {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-item .dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfc5b7;
  flex-shrink: 0;
}

.user-item.online .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(88, 179, 104, 0.18);
}

.sidebar-footer {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.sidebar-footer .icon-btn:last-child {
  margin-left: auto;
}

/* 头像 */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  font-size: 19px;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 38px;
  border-radius: 20px;
}

/* 主聊天区 */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 15px;
}

.conn-state {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
}

.conn-state.offline {
  color: var(--danger);
}

.unread-badge {
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 消息气泡 */
.message {
  display: flex;
  gap: 10px;
  max-width: 78%;
  animation: pop 0.18s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.message.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  align-self: flex-end;
}

.message-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 0 4px;
}

.message.mine .meta {
  justify-content: flex-end;
}

.bubble {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 10px 13px;
  font-size: 14.5px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 2px 6px rgba(196, 137, 76, 0.08);
}

.message.mine .bubble {
  background: linear-gradient(135deg, #ffb066, #f38d3c);
  color: #fff;
  border: 0;
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(233, 143, 63, 0.28);
}

.message img.chat-image {
  max-width: 260px;
  max-height: 240px;
  border-radius: 14px;
  cursor: zoom-in;
  display: block;
  border: 1px solid var(--line);
}

.message .sticker {
  font-size: 62px;
  line-height: 1;
}

.read-state {
  font-size: 11px;
  color: var(--ink-soft);
  text-align: right;
  padding: 0 4px;
}

/* 输入区 */
.composer {
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
  position: relative;
  background: #fffdf9;
}

.composer-buttons {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}

.panel {
  position: absolute;
  bottom: 58px;
  left: 14px;
  width: 330px;
  max-width: calc(100% - 28px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 5;
}

.panel button {
  border: 0;
  background: transparent;
  font-size: 22px;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.12s, transform 0.12s;
}

.panel button:hover {
  background: var(--primary-soft);
  transform: scale(1.12);
}

.panel.sticker-panel {
  grid-template-columns: repeat(4, 1fr);
}

.panel.sticker-panel button {
  font-size: 34px;
  padding: 8px;
}

.composer-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#input {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 14.5px;
  line-height: 1.45;
  max-height: 150px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

#input:focus {
  border-color: var(--primary);
}

.send-btn {
  padding: 11px 22px;
}

/* ---------- 朋友圈 ---------- */
.moments-view {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(70, 45, 25, 0.38);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.moments-panel {
  width: min(620px, 100%);
  background: var(--bg);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.moments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #ffb066, var(--primary-deep));
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.moments-header .icon-btn {
  color: #fff;
}

.moments-header .icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.moments-composer {
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.moments-composer textarea {
  width: 100%;
  resize: none;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14.5px;
  line-height: 1.5;
  outline: none;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s;
}

.moments-composer textarea:focus {
  border-color: var(--primary);
}

.moments-composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.moments-composer-actions .btn-ghost {
  padding: 8px 14px;
  font-size: 13px;
}

.moments-composer-actions .btn-primary {
  margin-left: auto;
  padding: 9px 20px;
  font-size: 14px;
}

.moment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.moment-image-thumb {
  position: relative;
  width: 64px;
  height: 64px;
}

.moment-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(70, 45, 25, 0.85);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moment-images-hint {
  font-size: 12px;
  color: var(--ink-soft);
}

.moment-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.moment-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(196, 137, 76, 0.1);
  animation: pop 0.18s ease;
}

.moment-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.moment-info {
  flex: 1;
  min-width: 0;
}

.moment-name {
  font-weight: 700;
  font-size: 15px;
}

.moment-time {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.moment-delete {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 8px;
}

.moment-delete:hover {
  background: #fdecec;
  color: var(--danger);
}

.moment-content {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.moment-image-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.moment-image-grid.single {
  grid-template-columns: minmax(0, 260px);
}

.moment-image-grid img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.moment-image-grid.single img {
  height: auto;
  max-height: 360px;
}

.moment-actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.moment-like {
  border: 0;
  background: var(--bg-soft);
  color: var(--ink-soft);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  transition: all 0.15s;
}

.moment-like:hover {
  background: var(--primary-soft);
}

.moment-like.liked {
  background: #fdecec;
  color: var(--danger);
}

.moment-likes {
  margin-top: 10px;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--primary-deep);
  line-height: 1.5;
}

.moment-comments {
  margin-top: 8px;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 8px 12px;
}

.moment-comment {
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}

.moment-comment-author {
  font-weight: 700;
  color: var(--primary-deep);
  margin-right: 6px;
}

.comment-delete {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  margin-left: 8px;
  padding: 2px 4px;
}

.comment-delete:hover {
  color: var(--danger);
}

.moment-comment-row {
  margin-top: 10px;
}

.moment-comment-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  background: #fffdf9;
  color: var(--ink);
  transition: border-color 0.15s;
}

.moment-comment-input:focus {
  border-color: var(--primary);
}

/* ---------- 私聊 ---------- */
.private-view {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(70, 45, 25, 0.38);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.private-panel {
  width: min(620px, 100%);
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.private-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.private-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.private-title {
  font-weight: 800;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.private-online {
  font-size: 12px;
  color: var(--ink-soft);
}

.private-online.online {
  color: var(--green);
}

.private-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.private-composer {
  border-top: 1px solid var(--line);
  padding: 10px 14px 14px;
  position: relative;
  background: #fffdf9;
  flex-shrink: 0;
}

.private-composer-buttons {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  margin-top: 14px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: background 0.15s;
}

.conversation-item:hover {
  background: var(--primary-soft);
}

.conv-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.conv-time {
  font-size: 11px;
  color: var(--ink-soft);
}

.user-item {
  position: relative;
}

.private-badge {
  position: absolute;
  top: 4px;
  right: 30px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  min-width: 17px;
  height: 17px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- 用户详情 ---------- */
.user-card {
  text-align: center;
}

.user-card .avatar.large {
  margin: 6px auto 14px;
}

.user-card h2 {
  margin: 0;
  font-size: 20px;
}

.user-modal-username {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 4px 0 2px;
}

.user-modal-status {
  font-size: 13px;
  margin: 2px 0 18px;
}

.user-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.user-modal-actions .btn-primary,
.user-modal-actions .btn-ghost {
  padding: 10px 16px;
}

/* ---------- 个人设置弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(70, 45, 25, 0.38);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow);
  max-height: 86vh;
  overflow-y: auto;
}

.modal-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.modal-card h3 {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 18px 0 10px;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 6px;
}

.settings-info p {
  margin: 2px 0;
  font-size: 14px;
}

.settings-info p:last-child {
  color: var(--ink-soft);
  font-size: 13px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-grid button {
  border: 0;
  background: transparent;
  font-size: 24px;
  padding: 7px;
  border-radius: 10px;
  transition: background 0.12s, transform 0.12s;
}

.emoji-grid button:hover,
.emoji-grid button.selected {
  background: var(--primary-soft);
  transform: scale(1.1);
}

.upload-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}

/* ---------- 图片大图 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 6, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  cursor: zoom-out;
  padding: 20px;
}

.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* ---------- 提示气泡 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(70, 45, 25, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 80;
  box-shadow: var(--shadow);
  max-width: 80vw;
}

/* ---------- 手机端适配 ---------- */
@media (max-width: 760px) {
  .view {
    padding: 0;
  }

  .auth-card {
    border-radius: 0;
    min-height: 100dvh;
    justify-content: center;
  }

  .chat-layout {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
  }

  .sidebar-header {
    padding: 10px 12px 6px;
  }

  .user-list-title {
    display: none;
  }

  .user-list {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 4px 8px 6px;
    max-height: 74px;
  }

  .user-item {
    flex-direction: column;
    gap: 3px;
    padding: 5px 7px;
    min-width: 64px;
    background: rgba(255, 255, 255, 0.55);
  }

  .user-item .avatar {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .user-item .uname {
    font-size: 11px;
    max-width: 62px;
  }

  .user-item .dot {
    margin: 0;
    width: 6px;
    height: 6px;
  }

  .sidebar-footer {
    border-top: 0;
    padding: 0 8px 8px;
  }

  .chat-main {
    flex: 1;
    min-height: 0;
  }

  .message {
    max-width: 86%;
  }

  .message img.chat-image {
    max-width: 210px;
  }

  .sidebar-tabs {
    padding: 0 8px 6px;
  }

  .moments-view {
    padding: 0;
  }

  .moments-panel {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .private-view {
    padding: 0;
  }

  .private-panel {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }
}
