/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Segoe UI", "PingFang SC", system-ui, -apple-system, sans-serif;
  background: #0a0a0a;
  color: #eee;
  line-height: 1.6;
}
a { color: #7c3aed; text-decoration: none; }
a:hover { color: #8b5cf6; }

/* === Section shared === */
.section { padding: 80px 40px; max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.section-sub { font-size: 16px; color: #888; max-width: 560px; margin: 0 auto; }
.highlight { color: #a78bfa; }

/* === Hero === */
.hero {
  min-height: 90vh; display: flex; flex-direction: column;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1025 40%, #0f1628 70%, #0a0a0a 100%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; top: -50%; right: -30%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.top-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px; position: relative; z-index: 1;
}
.logo { font-size: 24px; font-weight: 700; color: #7c3aed; letter-spacing: 2px; }
.top-nav a { font-size: 14px; color: #666; }
.top-nav a:hover { color: #999; }

.hero-content {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 0 20px; position: relative; z-index: 1;
}
.hero-content h1 { font-size: 48px; font-weight: 700; margin-bottom: 20px; max-width: 700px; line-height: 1.3; }
.lead { font-size: 18px; color: #999; margin-bottom: 36px; max-width: 560px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; }

/* === Buttons === */
.btn {
  display: inline-block; padding: 12px 28px; border-radius: 8px;
  font-size: 15px; font-weight: 500; cursor: pointer; border: none;
  transition: background 0.15s, transform 0.1s;
}
.btn.primary { background: #7c3aed; color: #fff; }
.btn.primary:hover { background: #8b5cf6; color: #fff; transform: translateY(-1px); }
.btn.secondary { background: #2a2a2a; color: #eee; }
.btn.secondary:hover { background: #3a3a3a; color: #eee; }

/* === Ecosystem Comparison === */
.ecosystem { background: #0d0d0d; max-width: 100%; padding: 80px 40px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; max-width: 1100px; margin: 0 auto; }
.compare-card {
  background: #141414; border: 1px solid #222; border-radius: 12px;
  padding: 28px 20px; text-align: center; transition: border-color 0.2s, background 0.2s;
}
.compare-card:hover { border-color: #333; background: #1a1a1a; }
.compare-card.highlight {
  border-color: #7c3aed; background: linear-gradient(180deg, rgba(124,58,237,0.08) 0%, rgba(124,58,237,0.02) 100%);
  position: relative; overflow: hidden;
}
.compare-card.highlight::before {
  content: "PC 优先"; position: absolute; top: 10px; right: -28px;
  background: #7c3aed; color: #fff; font-size: 10px; font-weight: 600;
  padding: 2px 32px; transform: rotate(45deg);
}
.compare-icon { font-size: 28px; display: block; margin-bottom: 10px; }
.compare-card h4 { font-size: 16px; color: #eee; margin-bottom: 6px; }
.compare-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 500; margin-bottom: 10px;
}
.compare-badge.ios { background: rgba(100,149,237,0.15); color: #6495ed; }
.compare-badge.android { background: rgba(124,210,124,0.15); color: #7cd27c; }
.compare-badge.multi { background: rgba(231,180,100,0.15); color: #e7b464; }
.compare-badge.web { background: rgba(100,180,220,0.15); color: #64b4dc; }
.compare-badge.pc { background: rgba(124,58,237,0.15); color: #a78bfa; }
.compare-card p { font-size: 13px; color: #888; line-height: 1.6; }

/* === Gift Wrap Security === */
.gift-wrap { background: #0a0a0a; }
.security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.security-card {
  background: #141414; border: 1px solid #222; border-radius: 12px;
  padding: 32px 24px; text-align: center;
}
.security-icon-wrap {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(124,58,237,0.1); margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
}
.security-svg { width: 28px; height: 28px; color: #a78bfa; }
.security-card h3 { font-size: 17px; color: #eee; margin-bottom: 12px; }
.security-card p { font-size: 13px; color: #888; line-height: 1.7; }

/* === Performance === */
.performance { background: #0d0d0d; max-width: 100%; padding: 80px 40px; }
.perf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1100px; margin: 0 auto; }
.perf-card {
  background: #141414; border: 1px solid #222; border-radius: 12px;
  padding: 36px 28px; text-align: center;
}
.perf-number { font-size: 52px; font-weight: 800; color: #7c3aed; display: block; margin-bottom: 8px; letter-spacing: -1px; }
.perf-unit { font-size: 24px; font-weight: 400; color: #a78bfa; }
.perf-card h3 { font-size: 17px; color: #eee; margin-bottom: 12px; }
.perf-card p { font-size: 13px; color: #888; line-height: 1.7; }

/* === Cross Platform === */
.cross-platform { background: #0a0a0a; }
.platform-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 700px; margin: 0 auto; }
.platform-card {
  background: #141414; border: 1px solid #222; border-radius: 12px;
  padding: 36px 28px; text-align: center;
}
.platform-svg { width: 40px; height: 40px; color: #7c3aed; margin-bottom: 20px; }
.platform-card h3 { font-size: 17px; color: #eee; margin-bottom: 12px; }
.platform-card p { font-size: 13px; color: #888; line-height: 1.7; }

/* === Feature Grid === */
.all-features { background: #0d0d0d; max-width: 100%; padding: 80px 40px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1100px; margin: 0 auto; }
.feature-card {
  background: #141414; border: 1px solid #222; border-radius: 12px;
  padding: 32px 24px; transition: border-color 0.2s;
}
.feature-card:hover { border-color: #333; }
.feature-card h3 { font-size: 16px; margin-bottom: 12px; color: #eee; }
.feature-card p { font-size: 13px; color: #888; line-height: 1.7; }

/* === CTA === */
.cta-section {
  text-align: center; padding: 80px 40px; background: #0a0a0a;
  max-width: 100%;
}
.cta-section h2 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.cta-section p { font-size: 16px; color: #888; margin-bottom: 32px; }

/* === Footer === */
.footer {
  text-align: center; padding: 24px; border-top: 1px solid #222;
  color: #555; font-size: 13px;
}

/* === Nostr vs Categories Comparison Table === */
.what-is-nostr { background: #0d0d0d; max-width: 100%; padding: 80px 40px; }

.marketing-banner {
  max-width: 700px; margin: 0 auto 40px; text-align: center;
  background: linear-gradient(135deg, rgba(231,76,60,0.08), rgba(124,58,237,0.06));
  border: 1px solid rgba(231,76,60,0.15); border-radius: 10px;
  padding: 20px 28px;
}
.marketing-banner p { color: #ccc; font-size: 16px; line-height: 1.7; }
.marketing-banner strong { color: #e74c3c; }

.compare-table-wrap { max-width: 1100px; margin: 0 auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 800px; }
.compare-table thead th {
  padding: 14px 12px; text-align: left; font-weight: 600;
  color: #999; border-bottom: 2px solid #333; font-size: 15px;
  vertical-align: bottom; line-height: 1.5;
}
.compare-table thead th.col-cipher { color: #a78bfa; }
.app-tag {
  display: block; font-weight: 400; font-size: 12px; color: #999; margin-top: 3px;
  line-height: 1.5;
}
.compare-table tbody td {
  padding: 12px 12px; border-bottom: 1px solid #222; color: #bbb;
  vertical-align: top; line-height: 1.7; font-size: 14px;
}
.compare-table tbody td.row-label { color: #888; font-weight: 500; font-size: 13px; white-space: nowrap; }
.compare-table tbody td.col-cipher { color: #c4b5fd; background: rgba(124,58,237,0.06); }

/* === Technical Whitepaper === */
.tech-whitepaper { background: #0a0a0a; }
.tech-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.tech-card {
  background: #141414; border: 1px solid #222; border-radius: 12px;
  padding: 32px 28px;
}
.tech-card h3 { font-size: 16px; color: #a78bfa; margin-bottom: 12px; font-family: "Consolas", "Monaco", monospace; }
.tech-card p { font-size: 13px; color: #999; line-height: 1.8; }

/* ==============================================
   Admin styles (unchanged)
   ============================================== */
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 24px; height: 48px;
  background: #1a1a1a; border-bottom: 1px solid #333; flex-shrink: 0;
}
.topbar-brand { font-size: 16px; font-weight: 700; color: #7c3aed; letter-spacing: 1px; }
.topbar-logout { color: #888; font-size: 13px; text-decoration: none; padding: 4px 10px; border-radius: 4px; }
.topbar-logout:hover { color: #e74c3c; background: rgba(231,76,60,0.1); }

.admin-page { background: #111; min-height: 100vh; }
.login-box {
  max-width: 400px; margin: 120px auto;
  background: #1a1a1a; border: 1px solid #333;
  border-radius: 12px; padding: 36px;
}
.login-box h1 { text-align: center; font-size: 22px; margin-bottom: 24px; }
.input {
  width: 100%; padding: 10px 14px;
  background: #111; border: 1px solid #333; border-radius: 6px;
  color: #eee; font-size: 14px; margin-bottom: 14px;
}
.input:focus { border-color: #7c3aed; outline: none; }

.dashboard { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: #1a1a1a;
  border-right: 1px solid #333; padding: 24px;
}
.sidebar nav a {
  display: block; padding: 10px 12px; border-radius: 6px;
  color: #999; font-size: 14px; margin-bottom: 4px;
}
.sidebar nav a:hover, .sidebar nav a.active { background: #2a2a2a; color: #eee; }
.admin-main { flex: 1; padding: 32px; }
.admin-main h1 { font-size: 24px; margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
  background: #1a1a1a; border: 1px solid #333;
  border-radius: 10px; padding: 24px; text-align: center;
}
.stat-number { font-size: 36px; font-weight: 700; color: #7c3aed; display: block; }
.stat-label { font-size: 13px; color: #999; margin-top: 4px; }

/* Admin tables */
.data-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.data-table th { background: #1a1a1a; color: #7c3aed; padding: 10px 14px; text-align: left; font-size: 13px; font-weight: 600; border-bottom: 2px solid #333; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid #222; font-size: 13px; }
.data-table tr:hover td { background: #1a1a1a; }
.data-table td.mono { font-family: "Consolas", "Monaco", monospace; font-size: 12px; color: #aaa; }

/* User detail */
.user-detail { max-width: 900px; }
.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.detail-header h1 { margin-bottom: 0; }
.detail-header .back-btn {
  color: #888;
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 6px;
}
.detail-header .back-btn:hover { color: #eee; background: #2a2a2a; }
.badge-external {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(231,180,100,0.15);
  color: #e7b464;
  font-size: 12px;
}
.profile-card { background: #1a1a1a; border: 1px solid #333; border-radius: 10px; padding: 24px; margin-bottom: 24px; }
.profile-card h3 { color: #7c3aed; margin-bottom: 12px; }
.profile-card .field { margin-bottom: 8px; font-size: 14px; }
.profile-card .field-label { color: #888; }
.profile-card .field-value { color: #eee; word-break: break-all; }
.profile-card .field-value.mono { font-family: "Consolas", "Monaco", monospace; font-size: 12px; }

.tab-bar { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid #333; }
.tab-btn { padding: 10px 20px; background: none; border: none; color: #888; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.tab-btn:hover { color: #eee; }
.tab-btn.active { color: #7c3aed; border-bottom-color: #7c3aed; }

.list-group { background: #1a1a1a; border: 1px solid #333; border-radius: 8px; overflow: hidden; }
.list-item { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid #222; color: #eee; text-decoration: none; transition: background 0.1s; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #2a2a2a; }
.list-item .item-avatar { width: 36px; height: 36px; border-radius: 50%; background: #333; margin-right: 12px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #7c3aed; overflow: hidden; flex-shrink: 0; }
.list-item .item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.list-item .item-info { flex: 1; min-width: 0; }
.list-item .item-name { font-size: 14px; color: #eee; }
.list-item .item-sub { font-size: 12px; color: #888; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .item-meta { font-size: 12px; color: #666; flex-shrink: 0; }

/* Chat view */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 200px); margin-top: 16px; background: #111; border: 1px solid #333; border-radius: 10px; overflow: hidden; }
.chat-header { display: flex; align-items: center; padding: 12px 16px; background: #1a1a1a; border-bottom: 1px solid #333; flex-shrink: 0; }
.chat-header .back-btn { color: #888; text-decoration: none; margin-right: 12px; font-size: 18px; }
.chat-header .back-btn:hover { color: #eee; }
.chat-header .peer-name { font-size: 15px; color: #eee; font-weight: 500; }
.chat-header .refresh-btn { margin-left: auto; background: #2a2a2a; color: #eee; border: 1px solid #333; padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.chat-header .refresh-btn:hover { background: #3a3a3a; }

.message-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.message-bubble { max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; word-break: break-word; position: relative; }
.message-bubble.sent { align-self: flex-end; background: #7c3aed; color: #fff; border-bottom-right-radius: 4px; }
.message-bubble.received { align-self: flex-start; background: #2a2a2a; color: #ddd; border-bottom-left-radius: 4px; }
.message-bubble .msg-time { font-size: 10px; margin-top: 4px; opacity: 0.6; }
.message-bubble .msg-kind { font-size: 9px; opacity: 0.5; margin-bottom: 2px; text-transform: uppercase; }
.message-bubble .msg-content { white-space: pre-wrap; }
.message-empty { text-align: center; color: #666; padding: 40px; font-size: 14px; }
.message-loading { text-align: center; color: #666; padding: 24px; font-size: 13px; }

.flash-error { background: rgba(231,76,60,0.15); color: #e74c3c; padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; text-align: center; }

/* === Responsive === */
@media (max-width: 768px) {
  .section { padding: 48px 20px; }
  .ecosystem, .performance, .all-features { padding: 48px 20px; }
  .hero-content h1 { font-size: 28px; }
  .section-header h2 { font-size: 24px; }
  .compare-grid { grid-template-columns: 1fr; }
  .security-grid, .perf-grid, .platform-grid, .feature-grid, .tech-grid { grid-template-columns: 1fr; }
  .perf-number { font-size: 40px; }
  .dashboard { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #333; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .message-bubble { max-width: 85%; }
}
/* === Admin group pages === */
.page-hint { color: #888; font-size: 13px; margin: -6px 0 18px; }
.badge-active { display: inline-block; padding: 1px 8px; border-radius: 10px; background: rgba(76,175,80,0.15); color: #81c784; font-size: 12px; }
.badge-removed { display: inline-block; padding: 1px 8px; border-radius: 10px; background: rgba(231,76,60,0.15); color: #e57373; font-size: 12px; }
.member-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-bottom: 1px solid #333; font-size: 12px; color: #aaa; }
.member-chip { padding: 2px 10px; border-radius: 12px; background: #222; border: 1px solid #333; }
.group-msg-row { padding: 10px 16px; border-bottom: 1px solid #2a2a2a; }
.gm-sender { font-size: 13px; font-weight: 600; color: #a78bfa; margin-bottom: 2px; }
.gm-content { font-size: 14px; color: #eee; white-space: pre-wrap; word-break: break-word; }
.gm-time { font-size: 11px; color: #777; margin-top: 4px; }

/* ── 媒体消息（图片/文件）展示 ── */
.adm-media-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 260px;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
}
.adm-media-img-wrap img {
  display: block;
  max-width: 260px;
  max-height: 320px;
  border-radius: 10px;
  object-fit: contain;
  background: #000;
}
.adm-media-img-wrap.expired { cursor: not-allowed; }
.adm-media-img-wrap.expired img { filter: grayscale(0.8); opacity: 0.55; }
.adm-media-expired-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.adm-media-dim {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.5);
  color: #ccc;
  font-size: 10px;
}
.adm-media-broken {
  min-width: 150px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  border: 1px dashed #444;
  border-radius: 10px;
  color: #888;
  font-size: 12px;
}
.adm-media-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  max-width: 250px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  cursor: pointer;
}
.adm-media-file:hover { background: rgba(255,255,255,0.08); }
.adm-media-file.expired, .adm-media-file.disabled { opacity: 0.65; cursor: not-allowed; }
.adm-media-file-icon { font-size: 24px; flex-shrink: 0; }
.adm-media-file-info { min-width: 0; }
.adm-media-file-name {
  font-size: 13px;
  font-weight: 500;
  color: #eee;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.adm-media-file-meta { font-size: 11px; color: #999; margin-top: 2px; }
.adm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.adm-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
}

/* 登录按钮：块级占满登录框宽度（居中） */
.btn.block { display: block; width: 100%; }

/* ── 消息热加载顶部提示 ── */
.load-hint {
  text-align: center;
  color: #888;
  font-size: 12px;
  padding: 6px 0;
  user-select: none;
  flex-shrink: 0;
}
.load-hint.muted { color: #555; }
/* 消息行容器：display:contents 让行直接参与 .message-list 的 flex 布局，
   同时允许增量前插/尾插而不重建整个列表（重建会重置 scrollTop 导致视口乱跳） */
#msgRows { display: contents; }

/* ── 消息定位高亮闪烁 ── */
.msg-highlight { animation: msg-flash 1.1s ease-in-out 3; border-radius: 8px; }
.dm-msg-row.msg-highlight { padding: 2px 4px; margin: 0 -4px; }
@keyframes msg-flash {
  0%, 100% { background: transparent; }
  50% { background: rgba(124,58,237,0.25); }
}

/* ── 会话内搜索（聊天头部搜索框 + 结果面板） ── */
.chat-search { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.chat-header .chat-search { margin-right: 8px; }
.chat-header .refresh-btn { margin-left: 0; }
.dm-chat { position: relative; }
.chat-container { position: relative; }
.dm-chat-header .dm-peer-info { min-width: 0; }
.chat-search-input {
  width: 170px;
  padding: 6px 10px;
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  color: #eee;
  font-size: 13px;
}
.chat-search-input:focus { border-color: #7c3aed; outline: none; }
.chat-search-btn {
  background: #2a2a2a;
  color: #eee;
  border: 1px solid #333;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.chat-search-btn:hover { background: #3a3a3a; }
.chat-search-panel {
  position: absolute;
  top: 62px;
  right: 16px;
  width: 340px;
  max-height: 55%;
  overflow-y: auto;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
}
.csp-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 12px;
  color: #888;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}
.csp-close {
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.csp-close:hover { color: #eee; }
.csp-item { padding: 8px 12px; border-bottom: 1px solid #222; cursor: pointer; }
.csp-item:hover { background: #242424; }
.csp-time { font-size: 11px; color: #777; margin-bottom: 2px; }
.csp-snippet { font-size: 13px; color: #ddd; word-break: break-word; }
.csp-empty, .csp-loading { padding: 16px; text-align: center; color: #777; font-size: 13px; }

/* ── 消息检索页 ── */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-bar .input { margin-bottom: 0; }
.search-input { flex: 1; min-width: 220px; }
.search-select { width: auto; min-width: 140px; flex-shrink: 0; }
.search-btn { flex-shrink: 0; }
.search-summary { color: #888; font-size: 13px; margin-bottom: 12px; }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.search-result {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 12px 16px;
}
.search-result:hover { border-color: #3a3a3a; }
.search-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}
.badge-dm {
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(100,180,220,0.15);
  color: #64b4dc;
  font-size: 12px;
  flex-shrink: 0;
}
.badge-group {
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  font-size: 12px;
  flex-shrink: 0;
}
.sr-chat { color: #eee; font-weight: 500; }
.sr-sender { color: #888; }
.sr-sender.mono, .mono { font-family: "Consolas", "Monaco", monospace; font-size: 11px; }
.sr-time { color: #666; margin-left: auto; }
.sr-content { font-size: 14px; color: #ddd; word-break: break-word; white-space: pre-wrap; }
.search-result mark {
  background: rgba(124,58,237,0.35);
  color: #f5f3ff;
  border-radius: 2px;
  padding: 0 2px;
}



/* ── 私聊会话页（PC 风格：左会话列表 + 右聊天内容） ── */
.btn-link {
  color: #a78bfa;
  text-decoration: none;
  font-size: 13px;
}
.btn-link:hover { text-decoration: underline; color: #c4b5fd; }
.dm-entry-btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #1a1a1a;
}
.dm-entry-btn:hover { background: #242424; text-decoration: none; }
.dm-main { padding: 0; display: flex; overflow: hidden; }
.dm-layout { display: flex; flex: 1; height: calc(100vh - 48px); }
.dm-sessions {
  width: 300px;
  min-width: 260px;
  border-right: 1px solid #2a2a2a;
  background: #161616;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dm-sessions-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}
.dm-sessions-header .back-btn {
  color: #888;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}
.dm-sessions-header .back-btn:hover { color: #eee; }
.dm-sessions-title { font-size: 14px; font-weight: 600; color: #eee; }
.dm-session-list { flex: 1; overflow-y: auto; }
.dm-session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #202020;
}
.dm-session-item:hover { background: #1f1f1f; }
.dm-session-item.active { background: #2b2438; border-left: 3px solid #7c3aed; }
.dm-session-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.dm-session-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dm-session-info { flex: 1; min-width: 0; }
.dm-session-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dm-session-name { font-size: 14px; color: #eee; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-session-time { font-size: 11px; color: #777; flex-shrink: 0; }
.dm-session-preview {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.dm-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #111;
}
.dm-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}
.dm-peer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.dm-peer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dm-peer-info { min-width: 0; }
.dm-peer-name { font-size: 15px; font-weight: 600; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-peer-sub { font-size: 11px; color: #777; }
.dm-msg-row { display: flex; }
.dm-msg-row.mine { justify-content: flex-end; }
.dm-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #2a2a2a;
  color: #ddd;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  border-bottom-left-radius: 4px;
}
.dm-bubble.mine {
  background: #7c3aed;
  color: #fff;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 4px;
}
.dm-msg-content { white-space: pre-wrap; }
.dm-msg-time { font-size: 10px; opacity: 0.6; margin-top: 4px; }
.day-separator {
  align-self: center;
  font-size: 11px;
  color: #888;
  background: #1f1f1f;
  padding: 2px 12px;
  border-radius: 10px;
  margin: 6px 0 2px;
  user-select: none;
}
@media (max-width: 900px) {
  .dm-sessions { width: 220px; min-width: 180px; }
  .dm-session-preview { display: none; }
}
