/* ══════════════════════════════════════════════
   聊聊 · 2014 复刻版
   风格：低饱和度香芋紫 · 纯扁平 · 超大圆角 · 大量留白
   禁止：渐变 / 发光 / 立体 / 直角 / 高饱和
   ══════════════════════════════════════════════ */

/* ── Web 字体：手写体系列（马善政楷书 + 站酷快乐体 + 清松手写体） ── */
@font-face {
  font-family: 'MaShanZheng';
  src: url('/fonts/ma-shan-zheng.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'ZCOOLKuaiLe';
  src: url('/fonts/zcool-kuaile.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'QingSongShouXie';
  src: url('/fonts/qing-song.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Design Tokens ── */
:root {
  --primary: #b8a8e0;         /* 品牌主色：低饱和香芋淡紫 */
  --primary-light: #d4c8f0;   /* 浅紫 */
  --primary-bg: #f5f0fc;      /* 极浅紫背景 */
  --mint: #b9e8d0;            /* 辅助：浅薄荷绿 */
  --sky: #b8ddf5;             /* 辅助：天浅蓝 */
  --blush: #f7d6e0;           /* 辅助：裸粉 */
  --bg: #ffffff;               /* 页面基底：纯白 */
  --card: #ffffff;             /* 卡片白色 */
  --text: #555555;             /* 正文深灰 */
  --text-title: #333333;       /* 标题灰黑 */
  --text-muted: #bbbbbb;       /* 辅助文字 */
  --text-light: #cccccc;       /* 更浅文字 */
  --border: #eeeeee;           /* 弱分割线 */
  --overlay: rgba(220,220,220,0.5); /* 遮罩：半透浅灰 */
  --radius: 24px;              /* 基础圆角 */
  --radius-lg: 30px;           /* 大圆角（按钮） */
  --radius-sm: 20px;           /* 小圆角 */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── 主题方案 ── */
body.theme-default {}

/* 男生：冷蓝 */
body.theme-male {
  --primary: #8ab4e0;
  --primary-light: #b8d6f0;
  --primary-bg: #f0f6fc;
  --mint: #a8d8e0;
  --sky: #b8ddf5;
  --blush: #d6e8f7;
}

/* 女生：暖粉 */
body.theme-female {
  --primary: #e0a0b8;
  --primary-light: #f0c8d6;
  --primary-bg: #fcf0f5;
  --mint: #e0b9c8;
  --sky: #f5d6e0;
  --blush: #f7d6e0;
}

/* 学生：清新绿 */
body.theme-student {
  --primary: #8ec8a0;
  --primary-light: #b8e0c8;
  --primary-bg: #f0faf4;
  --mint: #b9e8d0;
  --sky: #b8e0d8;
  --blush: #d0e8c8;
}

/* 上班族：简约灰蓝 */
body.theme-office {
  --primary: #8898b8;
  --primary-light: #b8c4d8;
  --primary-bg: #f2f4f8;
  --mint: #b0c0d0;
  --sky: #c8d0e0;
  --blush: #d0d8e0;
}

/* 中年人：沉稳米棕 */
body.theme-mature {
  --primary: #c0a888;
  --primary-light: #d8c8b0;
  --primary-bg: #f8f4ee;
  --mint: #d0c0a8;
  --sky: #e0d0b8;
  --blush: #e8d8c4;
}

/* 夜晚：深色模式 */
body.theme-night {
  --primary: #8898c0;
  --primary-light: #6a7a9a;
  --primary-bg: #2a2e3a;
  --bg: #1a1e2a;
  --card: #242838;
  --text: #d0d4e0;
  --text-title: #e8eaf0;
  --text-muted: #888ea0;
  --text-light: #606680;
  --border: #333850;
  --overlay: rgba(0,0,0,0.6);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: var(--primary-bg);
  height: 100vh; height: 100dvh;
  overflow: hidden;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.03em;
}

/* ── Pages ── */
.page { display: none; height: 100vh; height: 100dvh; width: 100%; max-width: 480px; margin: 0 auto; position: relative; }
.page.active { display: flex; flex-direction: column; }

/* ════════════════════════════════════════════
   LOGIN PAGE · 极简登录页
   ════════════════════════════════════════════ */
#login-page {
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(180deg, #f6f1fd 0%, #ffffff 52%, #fbf8ff 100%);
  overflow: hidden;
}

/* 装饰性背景圆 */
#login-page::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: var(--primary-bg);
  pointer-events: none;
  animation: blobDrift 16s ease-in-out infinite alternate;
}
#login-page::after {
  content: '';
  position: absolute;
  bottom: -15%;
  left: -25%;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--primary-bg);
  pointer-events: none;
  animation: blobDrift 22s ease-in-out infinite alternate-reverse;
}
@keyframes blobDrift {
  from { transform: translate(0, 0); }
  to   { transform: translate(-16px, 18px); }
}

.login-inner {
  position: relative;
  z-index: 1;
  width: 340px;
  max-width: 86vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-brand-illust { animation: fadeUp 0.7s ease-out both; }
.login-title        { animation: fadeUp 0.7s ease-out 0.12s both; }
.login-subtitle     { animation: fadeUp 0.7s ease-out 0.24s both; }
.login-nickname-area{ animation: fadeUp 0.7s ease-out 0.38s both; }
#join-btn           { animation: fadeUp 0.7s ease-out 0.5s both; }

/* ── 品牌插画：简约线条地球+相拥卡通人物 ── */
.login-brand-illust {
  position: relative;
  width: 140px; height: 140px;
  margin-bottom: 20px;
}
.illust-earth {
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 2.5px solid var(--primary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  animation: earthFloat 6s ease-in-out infinite;
}
@keyframes earthFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
/* 地球上的经纬线 */
.illust-earth::before {
  content: '';
  position: absolute;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  border: 1px solid rgba(184,168,224,0.25);
}
.illust-earth::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 70%;
  background: rgba(184,168,224,0.15);
  border-radius: 1px;
}

/* 两个人形：简约圆+线风格 */
.illust-person {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: transparent;
}
.illust-person::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 18px;
  background: var(--primary);
  border-radius: 1px;
}
.illust-person-left {
  left: 18px;
  top: 38px;
}
.illust-person-left::before {
  content: '';
  position: absolute;
  top: 12px;
  right: -10px;
  width: 10px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transform: rotate(-20deg);
}
.illust-person-right {
  right: 18px;
  top: 38px;
}
.illust-person-right::before {
  content: '';
  position: absolute;
  top: 12px;
  left: -10px;
  width: 10px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transform: rotate(20deg);
}
/* 爱心装饰 */
.illust-heart {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  opacity: 0.5;
  animation: heartFloat 2s ease-in-out infinite;
}
@keyframes heartFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50%      { transform: translateX(-50%) translateY(-4px); opacity: 0.8; }
}

.login-title {
  font-size: 28px;
  font-weight: 500;
  color: var(--text-title);
  letter-spacing: 6px;
  margin-bottom: 8px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  letter-spacing: 2px;
}

/* ── 昵称输入区（保留功能，但视觉轻量化） ── */
.login-nickname-area {
  width: 100%;
  margin-bottom: 16px;
}
.login-nickname-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.login-nickname-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.login-nickname-row input {
  flex: 1;
  padding: 13px 18px;
  border: 1.5px solid #ece5f8;
  border-radius: 999px;
  font-size: 15px;
  color: var(--text-title);
  background: #faf8fe;
  text-align: center;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  font-weight: 300;
  letter-spacing: 1px;
}
.login-nickname-row input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(184,168,224,0.15);
}
.login-nickname-row input::placeholder {
  color: var(--text-light);
  font-weight: 300;
}
.nickname-shuffle {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid #ece5f8;
  background: #faf8fe;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-muted);
  flex-shrink: 0;
}
.nickname-shuffle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.nickname-shuffle:active {
  transform: scale(0.92);
}

/* ── 开启聊聊 按钮 ── */
#join-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #c3b4ec 0%, #a894d8 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 8px;
  cursor: pointer;
  transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
  margin-top: 8px;
  box-shadow: 0 8px 22px rgba(168,148,216,0.35);
}
#join-btn:hover {
  background: linear-gradient(135deg, #cdbff2 0%, #b19fe0 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(168,148,216,0.45);
}
#join-btn:active {
  transform: scale(0.97);
}
#join-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.error-msg {
  color: #e07474;
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
  font-weight: 300;
}

/* ════════════════════════════════════════════
   TABBAR · 底部导航
   ════════════════════════════════════════════ */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--card);
  border-top: 0.5px solid var(--border);
  padding: 8px 0 calc(8px + var(--safe-bottom)) 0;
  z-index: 100;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  letter-spacing: 2px;
  transition: color 0.2s;
}
.tab.tab-active {
  color: var(--primary);
  font-weight: 800;
}

.badge {
  background: #e07474;
  color: #fff;
  font-size: 9px;
  line-height: 1.3;
  padding: 1px 5px;
  border-radius: 10px;
  position: absolute;
  top: -4px;
  right: 20%;
  min-width: 16px;
  text-align: center;
  font-weight: 400;
}
.badge.hidden { display: none; }

/* ── Tab Content ── */
.tab-content { display: none; flex: 1; min-height: 0; }
.tab-content.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* profile tab: 用 overflow:hidden 做裁剪容器，让 .profile-page 拿到确定高度 */
#tab-profile.active { overflow: hidden; }


.main-content {
  flex: 1; min-height: 0; overflow: hidden;
  padding-bottom: 52px;
  display: flex; flex-direction: column;
}
.tab-slider {
  display: flex; flex-direction: row; flex: 1; min-height: 0;
  width: 300%; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.tab-slider.no-transition { transition: none; }
.tab-slider .tab-content {
  display: flex;
  flex-direction: column;
  width: 33.333%;
  flex-shrink: 1;
  min-height: 0;
}

/* ════════════════════════════════════════════
   FEED · 动态广场
   ════════════════════════════════════════════ */
.feed-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  background: var(--bg);
  flex-shrink: 0;
  border-bottom: 0.5px solid var(--border);
}
.feed-header-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-title);
  letter-spacing: 2px;
}
.feed-create-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: var(--bg);
  color: var(--primary);
  font-size: 20px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}
.feed-create-btn:hover {
  background: var(--primary-bg);
}
.feed-create-btn:active {
  transform: scale(0.92);
}

.feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--primary-bg);
}

/* ── Feed Card ── */
.feed-card {
  background: var(--card);
  padding: 18px 18px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 0.5px solid var(--border);
  transition: all 0.15s;
}
.feed-card:last-child { margin-bottom: 0; }

.feed-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.feed-card-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  border: 1.5px solid var(--primary-light);
  background: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.feed-card-user {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-title);
  cursor: pointer;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.feed-card-user:hover { color: var(--primary); }
.feed-card-meta {
  font-size: 13px;
  line-height: 1;
  opacity: 0.85;
  font-weight: 400;
}
.feed-card-meta-female { color: #ec4899; } /* ♀ 粉色 */
.feed-card-meta-male { color: #60a5fa; }   /* ♂ 蓝色 */
.feed-card-time {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  font-weight: 300;
}

.feed-card-content {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 12px;
  word-break: break-word;
  color: var(--text);
  font-weight: 400;
  letter-spacing: 0.4px;
}

.feed-card-expiry {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 300;
}
.feed-card-expiry .countdown,
.feed-card-time .countdown {
  font-variant-numeric: tabular-nums;
}

.feed-card-images {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
}
.feed-card-images img {
  max-width: 100%;
  object-fit: cover;
  cursor: pointer;
  background: #f5f5f5;
}
.feed-card-images img:only-child {
  width: 100%;
  max-height: 380px;
  border-radius: 12px;
}
.feed-card-images img:not(:only-child) {
  width: calc(50% - 2px);
  max-height: 160px;
}

.feed-card-actions {
  display: flex;
  gap: 0;
  padding: 8px 0 0;
  border-top: 0.5px solid var(--border);
}
.feed-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border: none;
  padding: 8px 0;
  border-radius: 6px;
  font-weight: 400;
}
.feed-action:hover { color: var(--primary); background: var(--primary-bg); }
.feed-action.liked { color: #e07474; }
.feed-action.liked:hover { background: #fff5f5; }
.feed-action.comment-toggle:hover { color: #92c8a8; }
.feed-action.dm-action:hover { color: var(--primary); }

.feed-card-mood {
  font-size: 12px;
  color: var(--primary);
  font-weight: 400;
  background: var(--primary-bg);
  border-radius: 12px;
  padding: 0 8px;
  display: inline-block;
  line-height: 1.9;
}
.feed-action.hug-btn { color: var(--primary); font-weight: 400; }
.feed-action.hug-btn:hover { color: #92c8a8; }

/* ── Comments ── */
.feed-comments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border);
}
.feed-comment {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.6;
  align-items: baseline;
  font-weight: 300;
  color: var(--text);
}
.feed-comment .feed-comment-name {
  font-weight: 400;
  color: var(--text-title);
  white-space: nowrap;
}
.feed-comment-reply-arrow {
  color: var(--text-muted);
  font-size: 11px;
}
.feed-comment-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}
.comment-reply-btn {
  font-size: 11px;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 400;
}
.comment-reply-btn:active { opacity: 0.6; }

.reply-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
  font-weight: 300;
}
.reply-indicator strong { color: var(--primary); font-weight: 400; }
.reply-indicator .reply-cancel {
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 300;
}
.feed-comment-input-bar {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-direction: column;
}
.comment-input {
  flex: 1;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
  font-weight: 300;
  color: var(--text);
}
.comment-input:focus { border-color: var(--primary); }
.comment-send {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  font-weight: 400;
  transition: background 0.2s;
  align-self: flex-end;
}
.comment-send:hover { background: #c4b4e6; }
.comment-send:active { transform: scale(0.97); }

/* ── Pull to Refresh ── */
.pull-to-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
  height: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: height;
}
.pull-spinner {
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
@keyframes pullSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════
   DM / CHAT · 聊天界面
   ════════════════════════════════════════════ */

/* ── DM List View ── */
.dm-list-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.dm-list-view-with-notif {
  flex-direction: column !important;
}
.dm-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* 互动提醒入口 */
.notif-entry-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 24px);
  margin: 12px auto 4px;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--primary-bg);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--primary);
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.notif-entry-btn:hover { background: var(--primary-light); }
.notif-entry-btn:active { transform: scale(0.98); }
.notif-entry-btn .badge {
  position: static;
  margin-left: auto;
  background: var(--primary);
}

.dm-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 0.5px solid var(--border);
  background: transparent;
}
.dm-conv-item:hover { background: var(--primary-bg); }
.dm-conv-item:active { background: var(--primary-bg); }
.dm-conv-item:last-of-type { border-bottom: none; }
.dm-conv-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--primary);
}
.dm-conv-info { flex: 1; overflow: hidden; min-width: 0; }
.dm-conv-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-title);
  margin-bottom: 4px;
}
.dm-conv-last {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 300;
  line-height: 1.4;
}
.dm-conv-unread {
  background: #e07474;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-weight: 400;
}
.dm-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 60px 20px;
  font-weight: 300;
  line-height: 2;
}

/* ── DM Chat View ── */
.dm-chat-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  position: relative;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
}
.dm-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  min-height: 52px;
}
.dm-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-muted);
  line-height: 1;
  border-radius: 50%;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.dm-back-btn:hover { color: var(--primary); background: var(--primary-bg); }
.dm-back-btn:active { background: var(--primary-bg); transform: scale(0.92); }
.dm-chat-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-title);
  letter-spacing: 0.5px;
}
.dm-chat-header-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dm-chat-header-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.dm-chat-header-info { flex: 1; }
.dm-chat-header-info .dm-chat-name {
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  padding-bottom: 70px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dm-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  margin-bottom: 16px;
  animation: msgIn 0.2s ease-out;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dm-msg-own { align-self: flex-end; }
.dm-msg-other { align-self: flex-start; }

.dm-msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding: 0 4px;
  text-align: center;
  font-weight: 300;
}

.dm-msg-bubble {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  line-height: 1.7;
  word-break: break-word;
  font-weight: 400;
  letter-spacing: 0.3px;
}
.dm-msg-own .dm-msg-row { flex-direction: row-reverse; }
.dm-msg-own .dm-msg-bubble {
  background: var(--primary);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 1px 3px rgba(184,168,224,0.08);
}
.dm-msg-other .dm-msg-bubble {
  background: #f5f5f5;
  color: var(--text);
  border-radius: 4px 14px 14px 14px;
}

.dm-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.dm-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dm-msg-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ── DM Input Area ── */
.dm-input-area {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card);
  border-top: 0.5px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  align-items: center;
  padding-bottom: calc(10px + var(--safe-bottom, 0px));
}

.dm-plus-btn {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: var(--text-muted);
  line-height: 1;
}
.dm-plus-btn:hover { background: var(--primary-bg); color: var(--primary); }
.dm-plus-btn:active { transform: scale(0.92); }

.dm-input-wrapper {
  flex: 1;
  min-width: 0;
}
#dm-input {
  width: 100%;
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s;
  background: var(--bg);
  color: var(--text);
  font-weight: 300;
}
#dm-input:focus { border-color: var(--primary); }
#dm-input::placeholder { color: var(--text-light); }

.dm-voice-btn {
  width: 100%; height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  letter-spacing: 0.3px;
  font-weight: 300;
}
.dm-voice-btn .dm-voice-icon { opacity: 0.5; }
.dm-voice-btn:active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(0.98);
}
.dm-voice-btn:active .dm-voice-icon { opacity: 1; }

.dm-mode-toggle {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-muted);
}
.dm-mode-toggle:hover { background: var(--primary-bg); color: var(--primary); }
.dm-mode-toggle:active { transform: scale(0.92); }

#dm-send-btn {
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 1px;
}
#dm-send-btn { font-weight: 600; }
#dm-send-btn:hover { background: #c4b4e6; }
.dm-btn-inactive { opacity: 0.3 !important; cursor: default !important; }

/* ── DM Media ── */
.dm-msg-media { margin-top: 6px; }
.dm-msg-img-wrap {
  border-radius: 12px;
  overflow: hidden;
  display: inline-block;
}
.dm-msg-img {
  max-width: 220px; max-height: 220px;
  cursor: pointer;
  display: block;
  background: rgba(0,0,0,0.04);
  transition: transform 0.15s;
}
.dm-msg-img:hover { transform: scale(1.02); }
.dm-msg-img:active { transform: scale(0.98); }

.dm-msg-audio-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.04);
  cursor: pointer;
  transition: background 0.15s;
  min-width: 100px;
}
.dm-msg-audio-wrap:hover { background: rgba(0,0,0,0.08); }
.dm-msg-audio-wrap:active { transform: scale(0.97); }
.dm-msg-own .dm-msg-audio-wrap {
  background: rgba(255,255,255,0.15);
}
.dm-msg-own .dm-msg-audio-wrap:hover { background: rgba(255,255,255,0.25); }

.dm-msg-audio-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
}
.dm-msg-audio-wave span {
  width: 3px;
  background: var(--text-muted);
  border-radius: 2px;
  animation: waveAnim 0.8s ease-in-out infinite;
}
.dm-msg-audio-wave span:nth-child(1) { height: 6px; animation-delay: 0s; }
.dm-msg-audio-wave span:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.dm-msg-audio-wave span:nth-child(3) { height: 18px; animation-delay: 0.2s; }
.dm-msg-audio-wave span:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.dm-msg-audio-wave span:nth-child(5) { height: 6px; animation-delay: 0.4s; }

@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.5); }
  50%      { transform: scaleY(1); }
}
.dm-msg-audio-wrap.playing .dm-msg-audio-wave span { background: var(--primary); }
.dm-msg-audio-wrap.playing { background: rgba(184,168,224,0.12); }

.dm-msg-audio-duration {
  font-size: 12px;
  color: var(--text-secondary, #999);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 300;
}

.dm-msg-video-wrap {
  position: relative;
  display: inline-block;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.dm-msg-video-wrap:active { transform: scale(0.97); }
.dm-msg-video {
  max-width: 220px; max-height: 260px;
  display: block;
  background: rgba(0,0,0,0.06);
  object-fit: cover;
}
.dm-msg-video-playbtn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.2);
}

.video-player-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-player-full {
  width: 100%;
  max-height: 100%;
  outline: none;
}

/* 纯媒体消息气泡紧凑 */
.dm-msg .dm-msg-bubble:has(> .dm-msg-media:only-child) {
  padding: 4px;
  background: transparent !important;
}

/* ── 附件抽屉 ── */
.dm-attach-drawer {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 100;
}
.dm-attach-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--overlay);
}
.dm-attach-panel {
  position: absolute;
  bottom: 0; left: 0; width: 100%;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px calc(20px + var(--safe-bottom));
}
.dm-attach-panel-in { animation: panelUp 0.25s ease-out; }
.dm-attach-panel-out { animation: panelDown 0.2s ease-in; }
@keyframes panelUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes panelDown {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}
.dm-attach-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.dm-attach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 26px;
  cursor: pointer;
  padding: 16px 24px;
  border-radius: 12px;
  transition: background 0.15s;
  flex: 0 0 auto;
  min-width: 80px;
}
.dm-attach-item:hover { background: var(--primary-bg); }
.dm-attach-item:active { transform: scale(0.95); }
.dm-attach-item span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ════════════════════════════════════════════
   RECORDING · 录音浮层
   ════════════════════════════════════════════ */
.dm-recording-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 200;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dm-recording-ui {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border: 0.5px solid var(--border);
}
.dm-recording-active .dm-recording-ui {
  animation: recordPop 0.2s ease-out;
}
@keyframes recordPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.dm-recording-wave {
  width: 200px; height: 60px;
  border-radius: 12px;
}
.dm-recording-timer {
  font-size: 36px;
  font-weight: 300;
  color: var(--text-title);
  font-variant-numeric: tabular-nums;
}
.dm-recording-hint {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 20px;
  border-radius: var(--radius-sm);
  background: #f5f5f5;
  font-weight: 300;
}

/* ── Voice Preview ── */
#voice-preview-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.dm-preview-wave-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 80px;
}
.dm-preview-wave-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 60px;
}
.dm-preview-wave-bars span {
  display: block;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
  animation: previewWave 0.8s ease-in-out infinite alternate;
}
.dm-preview-wave-bars span:nth-child(1)  { height: 30px; animation-delay: 0.0s; }
.dm-preview-wave-bars span:nth-child(2)  { height: 45px; animation-delay: 0.05s; }
.dm-preview-wave-bars span:nth-child(3)  { height: 22px; animation-delay: 0.1s; }
.dm-preview-wave-bars span:nth-child(4)  { height: 50px; animation-delay: 0.15s; }
.dm-preview-wave-bars span:nth-child(5)  { height: 35px; animation-delay: 0.2s; }
.dm-preview-wave-bars span:nth-child(6)  { height: 18px; animation-delay: 0.25s; }
.dm-preview-wave-bars span:nth-child(7)  { height: 42px; animation-delay: 0.3s; }
.dm-preview-wave-bars span:nth-child(8)  { height: 55px; animation-delay: 0.35s; }
.dm-preview-wave-bars span:nth-child(9)  { height: 28px; animation-delay: 0.4s; }
.dm-preview-wave-bars span:nth-child(10) { height: 40px; animation-delay: 0.45s; }
.dm-preview-wave-bars span:nth-child(11) { height: 15px; animation-delay: 0.5s; }
.dm-preview-wave-bars span:nth-child(12) { height: 48px; animation-delay: 0.55s; }
.dm-preview-wave-bars span:nth-child(13) { height: 32px; animation-delay: 0.6s; }
.dm-preview-wave-bars span:nth-child(14) { height: 20px; animation-delay: 0.65s; }
.dm-preview-wave-bars span:nth-child(15) { height: 38px; animation-delay: 0.7s; }
.dm-preview-wave-bars span:nth-child(16) { height: 52px; animation-delay: 0.75s; }
.dm-preview-wave-bars span:nth-child(17) { height: 25px; animation-delay: 0.8s; }
.dm-preview-wave-bars span:nth-child(18) { height: 44px; animation-delay: 0.85s; }
.dm-preview-wave-bars span:nth-child(19) { height: 16px; animation-delay: 0.9s; }
.dm-preview-wave-bars span:nth-child(20) { height: 36px; animation-delay: 0.95s; }

@keyframes previewWave {
  from { opacity: 0.4; transform: scaleY(0.8); }
  to   { opacity: 1;   transform: scaleY(1); }
}
.dm-preview-play-btn {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: var(--bg);
  color: var(--primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
.dm-preview-play-btn:hover { background: var(--primary-bg); }
.dm-preview-play-btn:active { transform: scale(0.95); }

.dm-preview-actions {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}
.dm-preview-btn {
  flex: 1;
  max-width: 120px;
  padding: 10px 0;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: transform 0.12s;
}
.dm-preview-btn:active { transform: scale(0.95); }
.dm-preview-cancel {
  background: #f5f5f5;
  color: var(--text-muted);
}
.dm-preview-send {
  background: var(--primary);
  color: #fff;
}

/* ── Upload Progress ── */
.dm-upload-progress {
  position: absolute;
  bottom: 100%; left: 12px; right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card);
  border-radius: 12px 12px 0 0;
  border-top: 0.5px solid var(--border);
  z-index: 11;
}
.dm-upload-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
#dm-upload-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.dm-upload-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 300;
}

/* ════════════════════════════════════════════
   EDITOR · 新建动态
   ════════════════════════════════════════════ */
.editor-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--primary-bg);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: editorIn 0.25s ease-out;
}
.editor-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 480px;
  background: var(--bg);
}
@keyframes editorIn {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.editor-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card);
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.editor-header-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text-muted);
  font-weight: 300;
}
.editor-publish-btn {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 24px;
  font-weight: 400;
  letter-spacing: 1px;
}
.editor-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-title);
  letter-spacing: 1px;
}
.editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}
.editor-input {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-title);
  background: transparent;
  font-family: inherit;
  min-height: 120px;
  font-weight: 300;
  letter-spacing: 0.5px;
}
.editor-input::placeholder { color: var(--text-light); }
.editor-media-area {
  margin-top: 12px;
  min-height: 80px;
}
.editor-preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  object-fit: cover;
  background: #f5f5f5;
}
.editor-actions {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 0.5px solid var(--border);
  margin-top: auto;
}
.editor-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: #f5f5f5;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s;
  font-weight: 300;
}
.editor-action-btn:hover { background: var(--primary-bg); color: var(--primary); }
.editor-action-btn input { display: none; }

/* ── Mood Bar ── */
.editor-mood-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 8px;
}
.editor-mood-btn {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-weight: 300;
}
.editor-mood-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.editor-mood-btn.active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

/* ════════════════════════════════════════════
   PROFILE · 个人主页
   ════════════════════════════════════════════ */
.profile-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px calc(32px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px solid var(--primary-light);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.25s;
}
.profile-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.profile-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-name {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-title);
  letter-spacing: 0.5px;
}
.profile-edit-btn {
  font-size: 14px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.profile-edit-btn:hover { opacity: 0.7; }
.profile-device-id { display: none; }

.profile-avatar-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.profile-avatar-action {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-weight: 300;
}
.profile-avatar-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}



/* ── Random Avatar Picker ── */
#avatar-picker-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--overlay);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#avatar-picker-modal {
  background: var(--card);
  border-radius: var(--radius);
  width: 340px;
  max-width: 88vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0.5px solid var(--border);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
#avatar-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--border);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-title);
}
#avatar-picker-close {
  font-size: 18px;
  cursor: pointer;
  opacity: 0.4;
  background: none;
  border: none;
  padding: 4px;
}
#avatar-picker-close:hover { opacity: 0.7; }
#avatar-picker-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.avatar-picker-item {
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.avatar-picker-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-picker-item:hover { border-color: var(--primary); }
.avatar-picker-item:active { transform: scale(0.97); }
#avatar-picker-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 13px;
}
#avatar-picker-refresh {
  width: 100%;
  padding: 12px;
  border: none;
  border-top: 0.5px solid var(--border);
  background: var(--card);
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 400;
}
#avatar-picker-refresh:hover { background: var(--primary-bg); }

/* ── Profile Stats ── */
.profile-stats {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}
.profile-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.profile-stat-item span:last-child {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
}

.profile-grid {
  width: 100%;
  max-width: 340px;
  margin-top: 16px;
}
.profile-grid-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text);
  border: 0.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 300;
}
.profile-grid-item:hover { background: var(--primary-bg); color: var(--primary); }

.profile-menu {
  width: 100%;
  max-width: 340px;
  margin-top: 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 0.5px solid var(--border);
}
.profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  font-weight: 300;
}
.profile-menu-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.profile-menu-item:hover { background: var(--primary-bg); }
.profile-menu-item + .profile-menu-item {
  border-top: 0.5px solid var(--border);
}
.profile-menu-arrow {
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 300;
}

.profile-actions {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column; gap: 10px;
}
.profile-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  letter-spacing: 1px;
}
.profile-btn-primary {
  background: var(--primary);
  color: #fff;
}
.profile-btn-primary:hover { background: #c4b4e6; }
.profile-btn-primary:active { transform: scale(0.97); }
.profile-btn-danger {
  background: #f5f5f5;
  color: #e07474;
  border: 1px solid #f0d0d0;
}
.profile-btn-danger:hover { background: #fef0f0; border-color: #e07474; }

.profile-btn-outline {
  background: var(--bg);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.profile-btn-outline:hover { background: var(--primary-bg); }

.profile-actions-single {
  width: 100%; max-width: 340px; margin-top: 16px;
}
.profile-actions-single .profile-btn { width: 100%; }

.profile-my-posts {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 16px;
}
.profile-my-posts-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-title);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-my-posts-list { display: none; flex-direction: column; }
.profile-my-posts-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  padding: 20px 0;
}

/* ════════════════════════════════════════════
   NOTIFICATIONS
   ════════════════════════════════════════════ */
.notif-list-view, .notif-detail-view {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
}
.notif-list-header, .notif-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-title);
  letter-spacing: 0.5px;
}
.notif-list-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.notif-list-item {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-list-item:last-child { border-bottom: none; }
.notif-list-item:active { margin: 0 -16px; padding: 14px 16px; background: var(--primary-bg); }
.notif-list-item-icon { font-size: 20px; flex-shrink: 0; }
.notif-list-item-body { flex: 1; min-width: 0; }
.notif-list-item-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-list-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 300;
}
.notif-list-item-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 300;
}
.notif-list-item-expired { opacity: 0.5; }
.notif-list-item-expired .notif-list-item-title { text-decoration: line-through; }

.notif-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.notif-detail-post {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 0.5px solid var(--border);
  margin-bottom: 16px;
}
.notif-detail-post-user {
  font-size: 14px;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 6px;
}
.notif-detail-post-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 10px;
  white-space: pre-wrap;
  font-weight: 300;
}
.notif-detail-post-expired {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.notif-detail-section-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-title);
  margin-bottom: 10px;
}
.notif-detail-comment {
  padding: 10px 16px;
  margin-bottom: 6px;
  background: #f5f5f5;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 300;
}
.notif-detail-comment-name {
  font-weight: 400;
  color: var(--primary);
}
.notif-detail-comment-replyto {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-notif-list {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column;
  margin-top: 12px;
}
.profile-notif-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-title);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-notif-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-notif-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  border: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-weight: 300;
}
.profile-notif-item:active { background: var(--primary-bg); }
.notif-reply-btn {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  background: var(--primary);
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 4px;
  cursor: pointer;
}
.profile-notif-icon { font-size: 16px; flex-shrink: 0; }
.profile-notif-text { flex: 1; color: var(--text); }
.profile-notif-text strong { color: var(--primary); font-weight: 400; }
.profile-notif-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 300;
}

/* ════════════════════════════════════════════
   MODALS · 弹窗/浮层
   ════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--overlay);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 0.5px solid var(--border);
  animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
  from { transform: translateY(30px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 0.5px solid var(--border);
}
/* 聊天设置弹窗：标题栏更紧凑（高度约 -20%） */
#chat-settings-modal .modal-header {
  padding: 13px 16px;
}
#chat-settings-modal .modal-header span {
  font-size: 13px;
}
#chat-settings-modal .modal-close {
  width: 26px;
  height: 26px;
  font-size: 12px;
}
.modal-user-info { display: flex; align-items: center; gap: 12px; }
.modal-user-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  overflow: hidden;
}
.modal-user-name {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-title);
}
.modal-user-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 300;
}
.modal-close {
  background: #f5f5f5;
  border: none;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.notif-post-modal-content { max-height: 85vh; }
.notif-modal-body { padding: 12px 16px; }
.notif-modal-body .feed-card {
  border: none;
  margin: 0;
  padding: 0;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.modal-section-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-title);
  margin-bottom: 12px;
}
.modal-posts { min-height: 80px; }
.modal-posts-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  padding: 30px 0;
}
.modal-post-card {
  background: #f5f5f5;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
}
.modal-post-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
  font-weight: 300;
}
.modal-post-images { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.modal-post-images img {
  max-width: 100%;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f5f5;
}
.modal-post-images img.single { max-height: 250px; width: 100%; }
.modal-post-images img.multi { width: calc(50% - 2px); max-height: 150px; }
.modal-post-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 300;
}
.modal-post-stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 300;
}

/* ════════════════════════════════════════════
   IMAGE VIEWER · 图片查看器
   ════════════════════════════════════════════ */
.img-viewer-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.88);
  z-index: 999999;
  overflow: hidden;
}
.img-viewer-overlay .img-viewer-track {
  display: flex;
  height: 100%;
  align-items: center;
  transition: transform 0.25s ease;
  will-change: transform;
}
.img-viewer-overlay .img-viewer-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.img-viewer-overlay .img-viewer-slide img {
  max-width: 92%;
  max-height: 90%;
  object-fit: contain;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.img-viewer-overlay .img-viewer-count {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 13px;
  background: rgba(0,0,0,0.3); padding: 4px 14px; border-radius: 14px;
  z-index: 10; pointer-events: none;
  font-weight: 300;
}
.img-viewer-overlay .img-viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  user-select: none;
  transition: background 0.2s;
}
.img-viewer-overlay .img-viewer-nav:active { background: rgba(255,255,255,0.2); }
.img-viewer-overlay .img-viewer-nav-left { left: 12px; }
.img-viewer-overlay .img-viewer-nav-right { right: 12px; }
.img-viewer-overlay .img-viewer-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.img-viewer-overlay .img-viewer-close:hover { background: rgba(255,255,255,0.2); }

/* ════════════════════════════════════════════
   SCROLLBAR · 滚动条
   ════════════════════════════════════════════ */
.feed-list::-webkit-scrollbar,
.dm-messages::-webkit-scrollbar,
.dm-conv-list::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.notif-list-items::-webkit-scrollbar { width: 3px; }
.feed-list::-webkit-scrollbar-track,
.dm-messages::-webkit-scrollbar-track,
.dm-conv-list::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.notif-list-items::-webkit-scrollbar-track { background: transparent; }
.feed-list::-webkit-scrollbar-thumb,
.dm-messages::-webkit-scrollbar-thumb,
.dm-conv-list::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.notif-list-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Utility ── */
.feed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 0;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 300;
}
.feed-loading .pull-spinner {
  animation: pullSpin 0.8s linear infinite;
}
.feed-empty {
  text-align: center;
  padding: 80px 20px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 2;
  font-weight: 300;
}
.feed-card-expired {
  opacity: 0.3;
  pointer-events: none;
}
.feed-card-expired .feed-card-actions { display: none; }

/* ════════════════════════════════════════════
   RESPONSIVE · 响应式
   ════════════════════════════════════════════ */
@media (max-width: 640px) {
  .login-inner { width: 86vw; }
  .dm-input-area { padding: 10px 8px; gap: 4px; }
  #dm-input { padding: 8px 14px; font-size: 13px; }
  #dm-send-btn { padding: 8px 18px; font-size: 13px; }
  .profile-page { padding: 24px 16px; }
  .dm-msg-img { max-width: 180px; max-height: 180px; }
  .dm-msg-video { max-width: 180px; max-height: 220px; }
  .dm-msg-audio-wrap { min-width: 80px; }
}

/* ── 阅后即焚 ── */

/* 时钟按钮 */
#dm-burn-btn {
  background: none;
  border: 1px solid #eee;
  font-size: 20px;
  padding: 0;
  cursor: pointer;
  border-radius: 30px;
  line-height: 1;
  transition: all 0.2s ease;
  opacity: 0.8;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8a8e0;
}
#dm-burn-btn:hover,
#dm-burn-btn:active { opacity: 1; background: #f5f2ff; border-color: #b8a8e0; }
#dm-burn-btn.dm-burn-active {
  opacity: 1;
  color: #b8a8e0;
  background: #f0ecf8;
  font-size: 13px;
  width: auto;
  padding: 6px 10px;
  gap: 2px;
}

/* 选择弹窗 */
.burn-popup {
  display: none !important;
}
.burn-popup-arrow {
  display: none !important;
}
.burn-popup-title {
  display: none !important;
}
.burn-popup-option {
  display: none !important;
}

/* 消息气泡倒计时标记 */
.dm-msg-burn .dm-msg-bubble {
  border-color: #f0e6ff;
}
.dm-msg-burn-badge {
  display: inline-block;
  font-size: 11px;
  color: #b8a8e0;
  background: #f5f0ff;
  border-radius: 12px;
  padding: 2px 8px;
  margin-bottom: 4px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.dm-burn-urgent {
  color: #e74c3c !important;
  background: #fde8e8 !important;
  animation: burn-pulse 0.5s ease-in-out infinite alternate;
}
@keyframes burn-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* 阅后即焚：个人设置 */
#profile-burn-setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
#profile-burn-setting:active {
  background: #f5f5f5;
}
.profile-burn-value {
  font-size: 14px;
  color: #b8a8e0;
  font-weight: 500;
}

/* 消息淡出销毁动画 */
.dm-msg-burning {
  animation: dm-burn-fadeout 0.6s ease-out forwards;
}
@keyframes dm-burn-fadeout {
  0% { opacity: 1; transform: scale(1); max-height: 200px; }
  50% { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(0.8); max-height: 0; margin: 0; padding: 0; overflow: hidden; }
}

/* Legacy compatibility - used by JS */
.bb-card-header,
.bb-card-meta,
.bb-card-name,
.bb-card-location,
.bb-card-actions,
.bb-action,
.bb-comments,
.bb-avatar { /* kept for JS references, styled via feed-card equivalents */ }

/* ══════════════════════════════════════
   游戏：真心话大冒险 + 剪刀石头布
   ══════════════════════════════════════ */

/* ── 游戏弹窗 ── 
.game-popup {
  position: fixed;
  z-index: 9995;
  background: #fff;
  border: 0.5px solid #eee;
  border-radius: 24px;
  padding: 14px 10px;
  min-width: 200px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  animation: gamePopupIn 0.2s ease-out;
}

@keyframes gamePopupIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-popup-arrow {
  display: none;
}

.game-popup-title {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.game-popup-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-popup-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.game-popup-option:active {
  background: #f5f0fa;
}

.game-option-icon {
  font-size: 24px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.game-option-text {
  flex: 1;
  min-width: 0;
}
.game-option-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
}
.game-option-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.3;
}

/* ── 游戏消息卡片（聊天气泡内）── */
.dm-msg-game {
  max-width: 80%;
}
.dm-msg-game .dm-msg-row {
  display: block;
}
.dm-msg-game-inner {
  display: block;
}

.dm-game-card {
  background: #f8f5ff;
  border: 0.5px solid #ede5f5;
  border-radius: 20px;
  padding: 14px 16px;
  min-width: 180px;
}
.dm-msg-own .dm-game-card {
  background: #f0ebf8;
  border-color: #ddd6eb;
}

.dm-game-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.dm-game-icon {
  font-size: 16px;
}
.dm-game-label {
  font-size: 13px;
  font-weight: 500;
  color: #b8a8e0;
  letter-spacing: 0.3px;
}
.dm-game-category {
  font-size: 11px;
  color: #c6b8e0;
  margin-left: auto;
  background: #f0ebf8;
  padding: 2px 8px;
  border-radius: 10px;
}

.dm-game-body {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  font-weight: 400;
}

/* ── RPS 猜拳结果卡片 ── */
.dm-rps-card .dm-game-header {
  margin-bottom: 10px;
}

.dm-rps-choices {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}
.dm-rps-choice {
  font-size: 14px;
  color: #555;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dm-rps-result-draw {
  text-align: center;
  font-size: 15px;
  color: #b8a8e0;
  font-weight: 500;
  padding: 6px 0;
}
.dm-rps-result-win {
  text-align: center;
  font-size: 15px;
  color: #e8a87c;
  font-weight: 500;
  padding: 6px 0;
}

.dm-rps-dare {
  background: #fff8f0;
  border: 0.5px solid #f0e0d0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 6px;
  font-size: 13px;
  color: #8a7a6a;
  line-height: 1.5;
}
.dm-msg-own .dm-rps-dare {
  background: #f5f0fa;
  border-color: #ddd6eb;
}

/* ── RPS 出拳选择浮层 ── */
.rps-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(220,220,220,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.rps-panel {
  background: #fff;
  border: 0.5px solid #eee;
  border-radius: 24px;
  padding: 28px 24px 20px;
  width: 280px;
  max-width: 90vw;
  text-align: center;
  animation: gamePopupIn 0.25s ease-out;
}

.rps-title {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

.rps-hint {
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
}

.rps-choices {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.rps-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  font-size: 36px;
  border: 0.5px solid #eee;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 76px;
  background: #fafafa;
}
.rps-choice-btn span {
  font-size: 12px;
  color: #888;
}
.rps-choice-btn:active {
  background: #f0ecf8;
  border-color: #b8a8e0;
  transform: scale(0.95);
}

.rps-cancel-btn {
  border: none;
  background: transparent;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 20px;
}
.rps-cancel-btn:active {
  background: #f5f5f5;
}

/* ── 修改昵称弹窗 ── */
.nickname-modal-content {
  max-width: 360px;
}
.nickname-modal-body {
  padding: 24px 20px 8px;
}
.nickname-modal-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.nickname-modal-row input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-title);
  background: var(--bg);
  outline: none;
  transition: border-color 0.25s;
  font-weight: 300;
}
.nickname-modal-row input:focus {
  border-color: var(--primary);
}
.nickname-modal-shuffle {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.nickname-modal-shuffle:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.nickname-modal-shuffle:active {
  transform: scale(0.92);
}
.nickname-modal-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0;
  font-weight: 300;
}
.nickname-modal-footer {
  display: flex;
  gap: 10px;
  padding: 12px 20px 20px;
  justify-content: flex-end;
}
.nickname-modal-btn {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  font-weight: 400;
}
.nickname-modal-btn:active {
  opacity: 0.7;
}
.nickname-modal-cancel {
  background: #f0f0f0;
  color: var(--text-muted);
}
.nickname-modal-confirm {
  background: var(--primary);
  color: #fff;
}

.gender-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.gender-option:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.gender-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.profile-gender-value,
.profile-theme-value {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 300;
}

/* ── 主题选择器 ── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  font-weight: 400;
}
.theme-option:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.theme-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}
.theme-swatch {
  width: 20px; height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.06);
}

/* ── 聊天页顶部设置按钮 ── */
.dm-chat-settings-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}
.dm-chat-settings-btn:hover { background: var(--primary-bg); color: var(--primary); }
.dm-chat-settings-btn:active { transform: scale(0.9) rotate(30deg); }

/* ── 会话聊天设置弹窗 ── */
.cs-body { padding: 12px 14px; max-height: 50vh; overflow-y: auto; }
.cs-section-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-title);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.cs-bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cs-bg-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.cs-bg-option:hover { border-color: var(--primary); }
.cs-bg-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 1.5px var(--primary);
}
.cs-bg-swatch {
  width: 100%;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  display: block;
}
.cs-bg-none {
  background: var(--bg);
  border: 1px dashed var(--border);
}
.cs-bg-upload-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--primary-bg);
}
.cs-bg-option.loading { opacity: 0.5; pointer-events: none; }
.cs-bg-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.cs-bg-option.selected .cs-bg-name { color: var(--primary); }

.cs-bubble-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cs-bubble-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.cs-bubble-option:hover { border-color: var(--primary); }
.cs-bubble-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 1.5px var(--primary);
}
.cs-bubble-preview {
  width: 100%;
  height: 28px;
  background: var(--bg);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 6px;
  padding: 4px 5px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cs-bub-own, .cs-bub-other {
  display: block;
  width: 60%;
  height: 9px;
  background: var(--primary);
  border-radius: 4px;
}
.cs-bub-own { align-self: flex-end; background: var(--primary); }
.cs-bub-other { align-self: flex-start; background: #e5e5e5; }
.cs-bubble-preview[data-preview="gradient"] .cs-bub-own {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.cs-bubble-preview[data-preview="gradient"] .cs-bub-other {
  background: linear-gradient(135deg, #f0f0f5, #e0e0ea);
}
.cs-bubble-preview[data-preview="outline"] .cs-bub-own {
  background: transparent;
  border: 1px solid var(--primary);
  box-sizing: border-box;
}
.cs-bubble-preview[data-preview="outline"] .cs-bub-other {
  background: transparent;
  border: 1px solid #c8c8c8;
  box-sizing: border-box;
}
.cs-bubble-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.cs-bubble-option.selected .cs-bubble-name { color: var(--primary); }

.cs-reset-btn {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.cs-reset-btn:hover {
  color: var(--danger, #e74c6f);
  border-color: var(--danger, #e74c6f);
  background: rgba(231,76,111,0.05);
}

/* ── 会话气泡样式覆盖 ── */
.dm-chat-view[data-bubble="gradient"] .dm-msg-own .dm-msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.dm-chat-view[data-bubble="gradient"] .dm-msg-other .dm-msg-bubble {
  background: linear-gradient(135deg, #f2f2f7, #e4e4ee);
}
.dm-chat-view[data-bubble="outline"] .dm-msg-own .dm-msg-bubble {
  background: rgba(255,255,255,0.85);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}
.dm-chat-view[data-bubble="outline"] .dm-msg-other .dm-msg-bubble {
  background: rgba(255,255,255,0.85);
  border: 1.5px solid #d0d0d8;
  color: var(--text);
}

/* ── 会话字号/字体设置 ── */
.cs-font-size-title, .cs-font-family-title {
  font-size: 11px;
  color: var(--text-muted);
  margin: 8px 0 4px;
  font-weight: 400;
}
.cs-fontsize-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.cs-fontfamily-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cs-fontsize-option, .cs-fontfamily-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 2px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.cs-fontsize-option:hover, .cs-fontfamily-option:hover { border-color: var(--primary); }
.cs-fontsize-option.selected, .cs-fontfamily-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 1.5px var(--primary);
}
.cs-fontsize-a {
  display: block;
  font-size: 16px;
  line-height: 1;
  padding: 6px 0;
  color: var(--text);
}
.cs-fontsize-a.small { font-size: 13px; }
.cs-fontsize-a.large { font-size: 19px; }
.cs-fontsize-a.xlarge { font-size: 21px; }
.cs-fontfamily-a {
  display: block;
  font-size: 14px;
  line-height: 1;
  padding: 6px 0;
  color: var(--text);
  white-space: nowrap;
}
.cs-fontfamily-a.mono {
  font-family: "Courier New", Consolas, monospace;
}
.cs-fontfamily-a.serif {
  font-family: "Songti SC", "STSong", "SimSun", "宋体", serif;
}
.cs-fontfamily-a.mashanzheng {
  font-family: "MaShanZheng", "Kaiti SC", "楷体", cursive;
}
.cs-fontfamily-a.kuaile {
  font-family: "ZCOOLKuaiLe", "MaShanZheng", "楷体", cursive;
}
.cs-fontfamily-a.qingsong {
  font-family: "QingSongShouXie", "ZCOOLKuaiLe", "楷体", cursive;
}

.dm-chat-view[data-font-size="small"] .dm-msg-bubble { font-size: 14px; }
.dm-chat-view[data-font-size="large"] .dm-msg-bubble { font-size: 18px; }
.dm-chat-view[data-font-size="xlarge"] .dm-msg-bubble { font-size: 20px; }
.dm-chat-view[data-font-family="mono"] .dm-msg-bubble {
  font-family: "Courier New", Consolas, monospace;
}
.dm-chat-view[data-font-family="serif"] .dm-msg-bubble {
  font-family: "Songti SC", "STSong", "SimSun", "宋体", serif;
}
.dm-chat-view[data-font-family="mashanzheng"] .dm-msg-bubble {
  font-family: "MaShanZheng", "Kaiti SC", "楷体", cursive;
  letter-spacing: 1px;
}
.dm-chat-view[data-font-family="kuaile"] .dm-msg-bubble {
  font-family: "ZCOOLKuaiLe", "MaShanZheng", "楷体", cursive;
  letter-spacing: 0.5px;
}
.dm-chat-view[data-font-family="qingsong"] .dm-msg-bubble {
  font-family: "QingSongShouXie", "ZCOOLKuaiLe", "楷体", cursive;
  letter-spacing: 0.5px;
}

/* ── 自定义调色弹窗 ── */
.cc-body { padding: 16px; }
.cc-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cc-preview-swatch {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
  background: #b8a8e0;
}
.cc-preview-hex {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
  font-family: monospace;
  letter-spacing: 0.5px;
}
.cc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cc-label {
  width: 44px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cc-slider {
  flex: 1;
  height: 22px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
.cc-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
}
.cc-slider-hue::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6, #ff6b6b);
}
.cc-slider-sat::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #d9d9d9, #ff6b6b);
}
.cc-slider-light::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #000000, #ffffff);
}
.cc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  margin-top: -7px;
}
.cc-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
}
.cc-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
}
.cc-val {
  width: 34px;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}
.cc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.cc-presets span {
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(0,0,0,0.08);
  transition: all 0.15s;
  box-sizing: border-box;
}
.cc-presets span:active { transform: scale(0.88); }
.cc-footer {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
}
.cc-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.cc-cancel {
  background: #f2f3f5;
  color: var(--text);
}
.cc-cancel:hover { background: var(--border); }
.cc-confirm {
  background: var(--primary);
  color: #fff;
}
.cc-confirm:hover { opacity: 0.9; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ════════════════════════════════════════════
   桌面端适配 · 居中卡片 + 品牌背景
   ════════════════════════════════════════════ */
@media (min-width: 640px) {
  body {
    background: var(--primary-bg);
    background-image:
      radial-gradient(ellipse at 20% 50%, rgba(184,168,224,0.12) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 50%, rgba(184,168,224,0.12) 0%, transparent 60%);
  }
  .page {
    box-shadow: 0 0 40px rgba(184,168,224,0.08);
    background: var(--bg);
    border-radius: 0;
  }
  .tabbar {
    box-shadow: 0 -2px 12px rgba(184,168,224,0.08);
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .editor-overlay {
    background: rgba(184,168,224,0.3);
  }
  .editor-page {
    border-radius: var(--radius);
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
    max-height: 90vh;
    margin: auto;
  }
}

/* ══════════════════════════════
   AI 智能体样式
   ══════════════════════════════ */
.ai-profile-card {
  padding: 20px 16px;
  text-align: center;
}
.ai-profile-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.ai-profile-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}
.ai-profile-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.ai-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.12));
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  border: 0.5px solid rgba(102,126,234,0.2);
}
.ai-chat-btn {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(102,126,234,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ai-chat-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(102,126,234,0.25);
}
.ai-profile-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}
.ai-badge-inline {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.4;
}

/* ── AI 智能体呼吸光晕动画 ── */
@keyframes ai-glow {
  0% { box-shadow: 0 2px 10px rgba(102,126,234,0.3); }
  50% { box-shadow: 0 2px 20px rgba(102,126,234,0.6), 0 0 30px rgba(118,75,162,0.25); }
  100% { box-shadow: 0 2px 10px rgba(102,126,234,0.3); }
}
@keyframes ai-breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

.dm-ai-avatar {
  animation: ai-glow 3s ease-in-out infinite;
}
.dm-ai-name .ai-badge-inline {
  animation: ai-breathe 2.5s ease-in-out infinite;
}

/* ── AI 消息气泡样式 ──
 * 默认下保持品牌渐变；用户选了会话气泡样式时，
 * 由 .dm-chat-view[data-bubble] 的高特异性规则覆盖（无 !important 才能被覆盖） */
.dm-msg-other .dm-msg-bubble.ai-bubble {
  background: linear-gradient(135deg, rgba(102,126,234,0.06), rgba(118,75,162,0.08));
  border: 0.5px solid rgba(102,126,234,0.15);
}

/* ── DM 页 AI 入口 ── */
.dm-ai-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 10px 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.08));
  border: 0.5px solid rgba(102,126,234,0.15);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.dm-ai-entry:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}
.dm-ai-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(102,126,234,0.3);
}
.dm-ai-info {
  flex: 1;
  min-width: 0;
}
.dm-ai-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.dm-ai-status {
  font-size: 12px;
  color: var(--text-muted);
}
.dm-ai-arrow {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}


