:root {
  --bg: #1a120c;
  --bg2: #24180f;
  --panel: #2c1d13;
  --panel2: #352418;
  --ink: #f5e6d3;
  --muted: #b9a08a;
  --amber: #f59e0b;
  --amber2: #fbbf24;
  --ember: #ea580c;
  --wood: #6b4226;
  --line: rgba(245, 198, 120, 0.18);
  --ok: #86efac;
  --danger: #fca5a5;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --font: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "Georgia", serif;
  --sans: "PingFang SC", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(245,158,11,.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(234,88,12,.12), transparent 50%),
    linear-gradient(180deg, #120c08 0%, var(--bg) 40%, #140e09 100%);
}
a { color: var(--amber2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 64px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(26,18,12,.82);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 14px; padding: 12px 0; }

/* language toggle */
.lang-toggle {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; background: rgba(0,0,0,.25);
  flex-shrink: 0;
}
.lang-opt {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 12px; cursor: pointer; font-size: .78rem; font-weight: 700;
  letter-spacing: .02em; line-height: 1; min-width: 36px;
}
.lang-opt:hover { color: var(--ink); background: rgba(245,158,11,.08); }
.lang-opt.active {
  color: #1a120c; background: linear-gradient(135deg, var(--amber2), var(--amber));
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.35);
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.brand-logo {
  height: 48px; width: auto; max-width: min(220px, 42vw);
  object-fit: contain; display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.35));
}
.brand-text { min-width: 0; }
.brand h1 { margin: 0; font-family: var(--font); font-size: 1.15rem; letter-spacing: .04em; }
.brand small { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  background: var(--panel2); border: 1px solid var(--line); vertical-align: middle;
  flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; }
.avatar.lg { width: 72px; height: 72px; }
.avatar.placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; color: var(--amber2); background: rgba(245,158,11,.15);
}
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  max-width: 180px;
}
.user-chip-text #userChipName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.profile-avatar-row { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.author-row { display: inline-flex; align-items: center; gap: 8px; }

/* avatar badges: 蓝标 / 红标 / 金标 */
.avatar-wrap {
  position: relative; display: inline-flex; flex-shrink: 0;
  border-radius: 50%; padding: 2px;
  background: transparent;
}
.avatar-wrap .avatar { border: 2px solid var(--bg2); display: block; }
.avatar-wrap.lv-0 { background: transparent; box-shadow: none; }
.avatar-wrap.lv-1 {
  background: conic-gradient(from 210deg, #60a5fa, #2563eb, #93c5fd, #1d4ed8);
  box-shadow: 0 0 0 1px rgba(59,130,246,.35), 0 0 10px rgba(59,130,246,.25);
}
.avatar-wrap.lv-2 {
  background: conic-gradient(from 210deg, #f87171, #dc2626, #fca5a5, #b91c1c);
  box-shadow: 0 0 0 1px rgba(239,68,68,.4), 0 0 12px rgba(239,68,68,.3);
}
.avatar-wrap.lv-3 {
  background: conic-gradient(from 210deg, #fbbf24, #f59e0b, #fff7ed, #eab308);
  box-shadow: 0 0 0 1px rgba(251,191,36,.5), 0 0 14px rgba(251,191,36,.45);
}
.level-pip {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 18px; height: 16px; padding: 0 4px;
  border-radius: 999px; font-size: 9px; font-weight: 800;
  line-height: 16px; text-align: center;
  background: #1a120c; color: #93c5fd;
  border: 1px solid rgba(96,165,250,.55);
  pointer-events: none;
}
.avatar-wrap.lv-0 .level-pip { display: none; }
.avatar-wrap.lv-1 .level-pip { color: #93c5fd; border-color: rgba(59,130,246,.55); }
.avatar-wrap.lv-2 .level-pip { color: #fca5a5; border-color: rgba(239,68,68,.55); }
.avatar-wrap.lv-3 .level-pip { color: #fde68a; border-color: rgba(251,191,36,.7); }
.level-chip {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; margin-left: 2px;
  border: 1px solid var(--line); color: var(--muted);
  background: rgba(0,0,0,.2); white-space: nowrap; vertical-align: middle;
}
.level-chip.lv-0 { display: none; }
.level-chip.lv-1 { color: #93c5fd; border-color: rgba(59,130,246,.45); background: rgba(37,99,235,.18); }
.level-chip.lv-2 { color: #fca5a5; border-color: rgba(239,68,68,.5); background: rgba(220,38,38,.18); }
.level-chip.lv-3 { color: #fde68a; border-color: rgba(251,191,36,.55); background: rgba(251,191,36,.16); }
.author-meta { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.2; }
.author-name { font-size: .9rem; }
.author-row { gap: 10px; align-items: center; }
.user-chip { gap: 10px; max-width: 240px; padding-right: 12px; }
.user-chip-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.user-chip-text #userChipName { font-size: .82rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.user-chip .level-chip { margin-left: 0; font-size: .62rem; }
.levels-box { display: flex; flex-direction: column; gap: 8px; }
.level-legend-row { display: flex; flex-direction: column; gap: 2px; }
.level-legend-row .desc { color: var(--muted); font-size: .75rem; }
.profile-level-row { margin: 0 0 10px; }
@media (max-width: 820px) {
  .brand-logo { height: 40px; max-width: 140px; }
  .brand small { display: none; }
}
.spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; min-width: 200px;
}
.search input {
  background: transparent; border: 0; outline: 0; color: var(--ink); width: 160px;
}
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.btn:hover { border-color: var(--amber); }
.btn.primary {
  background: linear-gradient(135deg, var(--amber), var(--ember));
  color: #1a1008; border: 0; font-weight: 700;
}
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .side { order: 2; }
  .search input { width: 100px; }
}

.side .card, .main .card {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.side .card { padding: 14px; margin-bottom: 14px; }
.side h3 { margin: 0 0 10px; font-family: var(--font); font-size: 1rem; color: var(--amber2); }
.board-item {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink);
  margin-bottom: 4px; border: 1px solid transparent;
}
.board-item:hover, .board-item.active {
  background: rgba(245,158,11,.12); border-color: var(--line); text-decoration: none;
}
.board-item .desc { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(245,158,11,.12); color: var(--amber2); font-size: .78rem; border: 1px solid var(--line);
  cursor: pointer;
}
.tag:hover { background: rgba(245,158,11,.22); }

.hero {
  padding: 22px; margin-bottom: 14px;
  background:
    linear-gradient(120deg, rgba(245,158,11,.16), transparent 50%),
    linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.hero h2 { margin: 0 0 8px; font-family: var(--font); font-weight: 700; }
.hero p { margin: 0; color: var(--muted); line-height: 1.6; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; align-items: center; }

.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-item {
  padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); cursor: pointer;
}
.post-item:hover { border-color: rgba(245,158,11,.45); }
.post-item h3 { margin: 0 0 6px; font-size: 1.05rem; font-family: var(--font); }
.meta { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: .72rem; padding: 2px 8px; border-radius: 999px;
  background: rgba(234,88,12,.2); color: #fdba74; border: 1px solid rgba(234,88,12,.35);
}
.badge.pin { background: rgba(251,191,36,.2); color: #fde68a; }
.badge.digest { background: rgba(134,239,172,.15); color: var(--ok); }
.badge.bounty { background: rgba(96,165,250,.15); color: #93c5fd; }
.badge.promo { background: rgba(244,114,182,.15); color: #f9a8d4; }
.excerpt { color: var(--muted); margin: 8px 0 0; line-height: 1.55; font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.detail { padding: 18px; }
.detail h2 { margin: 0 0 8px; font-family: var(--font); }
.detail .body { white-space: pre-wrap; line-height: 1.7; margin: 14px 0; }
.detail .imgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.detail .imgs img { max-width: 220px; max-height: 160px; border-radius: 10px; border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.quote-box {
  border-left: 3px solid var(--amber); padding: 10px 12px; margin: 10px 0;
  background: rgba(0,0,0,.2); border-radius: 0 10px 10px 0; color: var(--muted);
}

.replies { margin-top: 18px; }
.reply {
  padding: 12px; border-top: 1px solid var(--line);
}
.reply.nested { margin-left: 22px; border-left: 2px solid var(--wood); padding-left: 12px; }
.composer textarea, .composer input, .modal input, .modal textarea, .modal select {
  width: 100%; background: #1a120c; color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; outline: none;
}
.composer textarea { min-height: 90px; resize: vertical; }
.composer { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto;
}
.modal h3 { margin: 0 0 12px; font-family: var(--font); }
.modal label { display: block; font-size: .85rem; color: var(--muted); margin: 8px 0 4px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111; color: #fff; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); z-index: 80; opacity: 0; transition: .2s;
}
.toast.show { opacity: 1; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 28px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---- mobile polish + new panels ---- */
.icon-btn { position: relative; min-width: 40px; padding: 8px 10px; }
.badge-dot {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; border: 1px solid #1a120c;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.modal-head h3 { margin: 0; }
.modal-wide { width: min(720px, 100%); }
.notif-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow: auto; }
.notif-item {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0,0,0,.18); cursor: pointer;
}
.notif-item.unread { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.08); }
.notif-item .meta { margin-top: 4px; }
.dm-layout { display: grid; grid-template-columns: 220px 1fr; gap: 0; min-height: 0; flex: 1; height: 100%; }
.dm-threads { overflow: auto; max-height: none; height: 100%; padding-right: 10px; margin-right: 6px; }
.dm-thread {
  padding: 10px 12px; border-radius: 14px; cursor: pointer; margin-bottom: 2px;
  border: none; background: transparent;
}
.dm-thread:hover, .dm-thread.active { background: rgba(245,158,11,.12); border: none; }
.dm-thread .preview { color: var(--muted); font-size: .78rem; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-chat { display: flex; flex-direction: column; min-height: 0; padding-left: 4px; }
.dm-peer { font-weight: 700; margin-bottom: 8px; color: var(--amber2); }

.dm-peer-title { margin-bottom: 6px; }
.dm-peer-actions {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 0 0 6px;
}
.dm-peer-actions .btn {
  flex-shrink: 0;
  font-weight: 600;
}

.dm-messages {
  flex: 1 1 auto; overflow: auto; min-height: 0; max-height: none;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 6px; border: none; background: transparent;
}
.dm-bubble {
  max-width: 82%; padding: 10px 15px; border-radius: 18px;
  background: rgba(255,255,255,.08); border: none; align-self: flex-start;
  white-space: pre-wrap; word-break: break-word; box-shadow: none;
  font-size: .98rem; line-height: 1.45;
}
.dm-bubble.mine {
  align-self: flex-end; background: rgba(245,158,11,.28); border: none;
  border-radius: 18px 18px 4px 18px;
}
.dm-bubble:not(.mine) { border-radius: 18px 18px 18px 4px; }
.dm-bubble.pending { opacity: .65; }
.dm-compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; border: none; flex-shrink: 0; }
.dm-compose textarea {
  flex: 1; min-height: 44px; max-height: 96px; border-radius: 16px; border: none;
  background: rgba(255,255,255,.06); padding: 10px 14px; resize: none;
  font-size: 1rem;
}
.dm-modal.modal {
  width: min(920px, 100%);
  height: min(88vh, 820px);
  max-height: 92vh;
  display: flex; flex-direction: column;
  padding: 12px 14px 10px;
  overflow: hidden;
  border-radius: 22px; border: none;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  background: rgba(28,20,14,.96);
}
.dm-modal .modal-head { border-bottom: none; padding-bottom: 2px; margin-bottom: 6px; flex-shrink: 0; }
.dm-modal .dm-layout { min-height: 0; flex: 1 1 auto; height: auto; }
.dm-modal .dm-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dm-modal .dm-peer { flex-shrink: 0; margin-bottom: 4px; }
.dm-modal .modal textarea,
.dm-compose textarea {
  border: none !important; border-radius: 16px !important;
  background: rgba(255,255,255,.07) !important;
}
.mod-reports { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.mod-card {
  padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.18);
}
.mod-card .actions { margin-top: 8px; }
.side-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35;
}
.side-close { margin-bottom: 8px; width: 100%; }
#menuBtn { display: none; }

@media (max-width: 820px) {
  #menuBtn { display: inline-flex; }
  .top-inner { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .search { order: 5; flex: 1 1 100%; min-width: 0; }
  .search input { width: 100%; }
  .brand-logo { height: 36px; max-width: 120px; }
  .user-chip { max-width: 120px; }
  .user-chip-text #userChipName { max-width: 70px; }
  #profileBtn { display: none !important; }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 300px);
    z-index: 36; overflow: auto; padding: 14px;
    background: rgba(26,18,12,.97); border-right: 1px solid var(--line);
    transform: translateX(-105%); transition: transform .2s ease;
    order: 0;
  }
  .side.open { transform: translateX(0); }
  .side-close { display: block !important; }
  .layout { margin-top: 12px; gap: 12px; }
  .hero { padding: 16px; }
  .post-item { padding: 12px; }
  .post-item h3 { font-size: 1rem; }
  .detail { padding: 14px; }
  .detail .imgs img { max-width: 100%; }
  .reply.nested { margin-left: 12px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .dm-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 0; height: 100%; }
  .dm-threads { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.06); max-height: 88px; padding-bottom: 6px; margin-right: 0; padding-right: 0; }
  .dm-modal.modal {
    width: 100%;
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 16px;
    padding: 8px 10px 8px;
  }
  .dm-modal .modal-head { margin-bottom: 4px; }
  .dm-modal .modal-head h3 { font-size: 1rem; }
  .dm-peer-title { margin-bottom: 4px; font-size: .95rem; }
  .dm-peer-actions { margin: 2px 0 4px !important; gap: 5px !important; }
  .dm-peer-actions .btn { padding: 5px 10px; font-size: .82rem; }
  .dm-messages { padding: 6px 2px; gap: 7px; }
  .dm-bubble { max-width: 88%; padding: 10px 13px; font-size: 1.02rem; line-height: 1.48; }
  .dm-bubble .from-name { font-size: .7rem; }
  .dm-compose { margin-top: 4px; gap: 6px; }
  .dm-compose textarea { min-height: 42px; font-size: 1.02rem; padding: 9px 12px; }
  .modal { padding: 14px; border-radius: 14px; }
  .modal-back { padding: 6px; align-items: stretch; }
  .toast { left: 12px; right: 12px; transform: none; width: auto; text-align: center; }
}
@media (max-width: 420px) {
  .btn.primary#newPostBtn { padding: 8px 12px; }
  #authBtn { padding: 8px 10px; font-size: .85rem; }
  .lang-opt { padding: 6px 8px; min-width: 30px; }
}

.wechat-share-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
}
.wechat-share-tip p {
  margin: 0 0 8px;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.45;
}
.share-actions { gap: 8px; }

.tips-box {
  margin: 14px 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--wood);
  border-radius: 10px;
  background: rgba(255, 180, 80, 0.06);
}
.tips-box h3 { margin: 0 0 8px; font-size: .95rem; }
.tip-list { display: flex; flex-direction: column; gap: 6px; }
.tip-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  font-size: .85rem; color: var(--muted);
}
.tip-row .tip-amt { color: var(--amber2); font-weight: 600; min-width: 72px; }
.tip-row .tip-from { font-family: ui-monospace, monospace; color: var(--text); }
.tip-row .tip-time { opacity: .85; }
.tip-row .tip-tx { color: var(--amber2); text-decoration: none; font-size: .75rem; }
.tip-row .tip-tx:hover { text-decoration: underline; }
.tip-row.muted { opacity: .7; }

.user-card-body { margin: 8px 0 14px; }
.user-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.user-card-stats { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin: 8px 0; }
.user-card-stats b { color: var(--text); }
.author-row { cursor: pointer; }
.author-row:hover .author-name { color: var(--amber2); text-decoration: underline; }
.user-hit-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.user-hit {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--wood); border-radius: 10px;
  background: rgba(255,180,80,.05); cursor: pointer;
}
.user-hit:hover { border-color: var(--amber2); }
.user-hit-meta { color: var(--muted); font-size: .78rem; }
.notif-item .tip-amt-hl { color: var(--amber2); font-weight: 600; }

.group-pick-list {
  max-height: 220px; overflow: auto; margin: 8px 0 12px;
  border: 1px solid var(--wood); border-radius: 8px; padding: 6px;
}
.group-pick-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
.group-pick-item:hover { background: rgba(255,180,80,.08); }
.group-pick-item input { accent-color: var(--amber2); }
.dm-thread .kind-tag {
  font-size: .7rem; color: var(--amber2); margin-right: 4px;
}
.dm-bubble .from-name { font-size: .72rem; color: var(--muted); margin-bottom: 2px; }

.user-hit-title {
  font-weight: 600; color: var(--amber2); margin-bottom: 6px; font-size: .9rem;
}
.user-hit {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.user-hit-main { min-width: 0; flex: 1; }
.user-hit-follow { flex-shrink: 0; }

/* —— group hongbao —— */
.hongbao-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.hongbao-btn:hover { filter: brightness(1.05); }

.dm-compose .hongbao-btn:not(.hidden) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 36px;
  padding: 0 12px;
  font-weight: 700;
  z-index: 2;
}

.dm-bubble.hb-wrap {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: 240px;
}
.dm-bubble.hb-wrap.mine { align-self: flex-end; }
.hb-card {
  background: linear-gradient(145deg, #e74c3c 0%, #c0392b 60%, #a93226 100%);
  color: #fff7e6;
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 180px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(192, 57, 43, .35);
  position: relative;
  overflow: hidden;
}
.hb-card::after {
  content: '';
  position: absolute;
  right: -10px; top: -10px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 215, 0, .15);
}
.hb-card .hb-title { font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.hb-card .hb-sub { font-size: .75rem; opacity: .9; margin-top: 4px; }
.hb-card .hb-status { font-size: .72rem; margin-top: 8px; opacity: .85; }
.hb-card.hb-done { filter: grayscale(.35) brightness(.9); cursor: default; }
.hb-card.hb-claimable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hb-card .hb-open {
  display: flex; align-items: center; justify-content: center;
  margin: 14px auto 6px; width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(160deg, #ffe08a 0%, #f1c40f 55%, #e0a800 100%);
  color: #7b241c; font-weight: 900; font-size: 1.35rem; line-height: 1;
  border: 2px solid rgba(255,255,255,.65);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  cursor: pointer; position: relative; z-index: 2;
  touch-action: manipulation; user-select: none;
  flex-shrink: 0;
}
.hb-card .hb-open:active { transform: scale(.94); filter: brightness(.95); }
.hb-claim-line { font-size: .8rem; }

.dm-peer-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  position: relative;
  z-index: 20;
  overflow: visible !important;
}
.dm-peer {
  overflow: visible !important;
  position: relative;
  z-index: 15;
}

/* dm-peer-actions-mobile-safe */
.dm-peer {
  overflow: visible !important;
  position: relative;
  z-index: 15;
  min-height: 0;
}
.dm-peer-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center;
  position: relative;
  z-index: 20;
  overflow: visible !important;
  margin: 4px 0 8px;
}
.dm-peer-actions #groupInviteBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex-shrink: 0;
  z-index: 30;
}
.dm-chat { overflow: visible; }

/* image picker preview + remove */
.img-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.img-pick { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.06); }
.img-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-pick .img-pick-x {
  position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.7); color: #fff; font-size: 15px; line-height: 24px;
  padding: 0; cursor: pointer; touch-action: manipulation;
}
.img-picks-clear { font-size: .8rem; align-self: center; }

/* mobile WeChat-style list/chat toggle */
.dm-back { display: none; }
@media (max-width: 820px) {
  .dm-modal .dm-layout { display: flex !important; flex-direction: column; }
  .dm-modal .dm-threads { max-height: none !important; height: auto; flex: 1 1 auto; min-height: 0; overflow: auto; border-bottom: none; }
  .dm-modal .dm-chat { flex: 1 1 auto; min-height: 0; }
  .dm-layout.m-list .dm-chat { display: none !important; }
  .dm-layout.m-chat .dm-threads { display: none !important; }
  .dm-layout.m-chat .dm-back { display: inline-flex; align-self: flex-start; margin-bottom: 4px; flex-shrink: 0; }
  .dm-modal .dm-thread { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.05); border-radius: 10px; }
}

#dmMuteBtn { min-width: 36px; padding: 6px 8px; font-size: 1rem; line-height: 1; }
#dmMuteBtn.muted { opacity: .55; }
