:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #161a23;
  --muted: #6b7280;
  --faint: #9aa1af;
  --line: #e9ecf3;
  --primary: #3b6cf6;
  --primary-dark: #2a55d4;
  --primary-soft: #eaf0ff;
  --danger: #e5484d;
  --ok: #12a594;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --bg: #0e1015;
  --card: #161920;
  --text: #e7e9ef;
  --muted: #9aa0ae;
  --faint: #767d8c;
  --line: #232733;
  --primary: #5b84ff;
  --primary-dark: #7a9cff;
  --primary-soft: #1b2742;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--text); }
::selection { background: var(--primary-soft); }

/* ---------- 布局 ---------- */
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 620px) 290px;
  gap: 24px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px 20px 90px;
  align-items: start;
  justify-content: center;
}

.sidebar { position: sticky; top: 24px; }
.rightbar { position: sticky; top: 24px; display: grid; gap: 14px; }

.main { min-width: 0; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .rightbar { display: none; }
}

@media (max-width: 768px) {
  .shell { grid-template-columns: 1fr; padding: 0 0 calc(66px + env(safe-area-inset-bottom)); gap: 0; }
  .sidebar { display: none; }
  .rightbar { display: none; }
}

/* ---------- 侧边栏 ---------- */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 20px;
  font-size: 17px; font-weight: 600; letter-spacing: .2px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; display: block; }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--muted); font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav a svg { width: 19px; height: 19px; flex: 0 0 19px; }
.nav .dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center;
}
.nav-sep { height: 1px; background: var(--line); margin: 12px 6px; }
.nav-foot { margin-top: 16px; padding: 0 6px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 12px; }
.side-user:hover { background: var(--card); }
.side-user .name { font-size: 14px; font-weight: 500; }
.side-user .sub { font-size: 12px; color: var(--faint); }

.btn-post {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin: 16px 0 6px; padding: 11px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background .15s;
}
.btn-post:hover { background: var(--primary-dark); }
.btn-post svg { width: 18px; height: 18px; flex: 0 0 18px; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--faint); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn-danger { color: var(--danger); border-color: var(--line); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.link { color: var(--primary); cursor: pointer; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 500; flex: 0 0 auto; overflow: hidden;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 55%; height: 55%; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.lg { width: 68px; height: 68px; font-size: 24px; }

.tag {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 6px;
  font-size: 11.5px; line-height: 18px;
  background: var(--primary-soft); color: var(--primary);
}
.tag.gray { background: rgba(120, 120, 130, .12); color: var(--muted); }
.tag.red { background: rgba(229, 72, 77, .12); color: var(--danger); }
.tag.gold { background: rgba(234, 179, 8, .15); color: #b45309; }

.input, .textarea, .select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text);
  font-size: 15px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 108, 246, .12);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.7; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); padding: 0 2px; }
.tabs button {
  background: none; border: none; padding: 10px 0 12px;
  font-size: 14.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--text); font-weight: 500; border-color: var(--primary); }
.tabs button:hover { color: var(--text); }

.empty { padding: 48px 20px; text-align: center; color: var(--faint); font-size: 14px; }
.empty .big { font-size: 15px; color: var(--muted); margin-bottom: 6px; }

.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--bg) 50%, var(--line) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.dot-red { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); display: inline-block; }

/* ---------- 帖子 ---------- */
.post { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: none; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-head .who { min-width: 0; }
.post-head .name { font-size: 14.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.post-head .time { font-size: 12.5px; color: var(--faint); }
.post-body { font-size: 15.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-body a { color: var(--primary); }
.post-more { font-size: 13.5px; color: var(--primary); cursor: pointer; margin-top: 4px; }

.media-grid { display: grid; gap: 4px; margin-top: 12px; }
.media-grid.n1 { grid-template-columns: 1fr; }
.media-grid.n2 { grid-template-columns: 1fr 1fr; }
.media-grid.n3 { grid-template-columns: repeat(3, 1fr); }
.media-grid.n4 { grid-template-columns: 1fr 1fr; }
.media-grid.n5, .media-grid.n6, .media-grid.n7, .media-grid.n8, .media-grid.n9 { grid-template-columns: repeat(3, 1fr); }
.media-grid .cell {
  position: relative; overflow: hidden; border-radius: 10px;
  background: var(--line); aspect-ratio: 1 / 1;
}
.media-grid.n1 .cell { aspect-ratio: auto; max-height: 340px; }
.media-grid.n1 .cell img { max-height: 340px; object-fit: contain; background: var(--bg); }
.media-grid.n2 .cell { aspect-ratio: 3 / 4; }
.media-grid .cell img { width: 100%; height: 100%; object-fit: cover; }
.media-grid .more {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .45); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 500;
}

.video-box { position: relative; margin-top: 12px; border-radius: 12px; overflow: hidden; background: #0b0d12; aspect-ratio: 16 / 9; }
.video-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-box .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: rgba(0, 0, 0, .18);
}
.video-box .play span {
  width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .92);
  display: flex; align-items: center; justify-content: center;
}
.video-box .play svg { width: 22px; height: 22px; color: #111; margin-left: 3px; }
.video-box .dur { position: absolute; right: 10px; bottom: 10px; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .55); padding: 1px 6px; border-radius: 5px; }

.post-actions { display: flex; gap: 22px; margin-top: 14px; color: var(--faint); font-size: 13.5px; }
.post-actions button {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; color: inherit; cursor: pointer; padding: 0; font-size: 13.5px;
}
.post-actions button svg { width: 17px; height: 17px; }
.post-actions button.on { color: var(--danger); }
.post-actions button.on.fav { color: #d69e2e; }
.post-actions button:hover { color: var(--text); }
.post-actions .more-btn { margin-left: auto; }

/* 投票 */
.poll { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.poll-head { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.poll-opt {
  position: relative; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; margin-bottom: 8px; cursor: pointer; overflow: hidden;
  font-size: 14px; transition: border-color .15s;
}
.poll-opt:hover { border-color: var(--primary); }
.poll-opt .bar { position: absolute; inset: 0; background: var(--primary-soft); width: 0; transition: width .4s; z-index: 0; }
.poll-opt .txt { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 10px; }
.poll-opt.voted { border-color: var(--primary); }
.poll-opt.voted .txt::after { content: "已选"; font-size: 11px; color: var(--primary); }
.poll-foot { font-size: 12.5px; color: var(--faint); display: flex; gap: 12px; align-items: center; margin-top: 4px; }

/* 评论 */
.comments { padding: 16px 20px 4px; }
.comment { display: flex; gap: 10px; padding: 10px 0; }
/* 一级评论的头像与右上角操作留出额外边距，别贴边框（二级评论已有缩进，不受影响） */
.comments > .comment { padding-left: 6px; padding-right: 6px; }
.comment .body { flex: 1; min-width: 0; }
.comment .meta { font-size: 13px; color: var(--faint); display: flex; gap: 8px; align-items: center; }
/* 时间不参与压缩：窄屏 + 超长昵称时，它会被挤成一字一行（App 端已修同样的坑） */
.comment .meta .c-time { white-space: nowrap; flex: none; }
/* 回复对象可以缩，长昵称只截断自己 */
.comment .meta .c-reply { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment .meta b { color: var(--text); font-weight: 500; font-size: 13.5px; }
.comment .txt { font-size: 14.5px; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.comment .meta .c-more { margin-left: auto; background: none; border: none; color: var(--faint); cursor: pointer; padding: 0; display: inline-flex; opacity: .6; }
.comment .meta .c-more svg { width: 16px; height: 16px; }
.comment .meta .c-more:hover { color: var(--text); opacity: 1; }
.comment .c-acts { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 6px; padding-right: 4px; }
.comment .c-acts .act-icon { background: none; border: none; color: var(--faint); cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.comment .c-acts .act-icon svg { width: 16px; height: 16px; }
.comment .c-acts .act-icon:hover { color: var(--text); }
.comment .c-acts .act-icon.on { color: var(--danger); }
.comment .fold-btn { background: none; border: none; color: var(--primary); cursor: pointer; padding: 4px 0 2px; font-size: 12.5px; display: block; font-family: inherit; }
.comment .fold-btn:hover { text-decoration: underline; }

/* 评论「⋯」三点菜单弹出层 */
.c-menu { position: fixed; z-index: 200; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; min-width: 96px; }
.c-menu button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); cursor: pointer; padding: 7px 12px; font-size: 13.5px; border-radius: 6px; font-family: inherit; }
.c-menu button:hover { background: var(--bg); }
.c-menu button:last-child { color: var(--danger); }
.comment.deleted .txt { color: var(--faint); font-style: italic; }
.comment-children { margin-left: 48px; border-left: 1px solid var(--line); padding-left: 2px; }

.reply-box { margin: 0 20px 16px; }
.reply-box .textarea { min-height: 76px; }

/* ---------- 发帖 ---------- */
.compose { padding: 18px 20px 20px; }
.compose .textarea { border: none; padding: 4px 0; min-height: 150px; font-size: 16px; }
.compose .textarea:focus { box-shadow: none; border: none; }
.compose-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 9px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 13.5px;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn.on { background: var(--primary-soft); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.thumb { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; background: var(--line); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none; cursor: pointer; font-size: 13px; line-height: 20px;
}
.thumb .prog { position: absolute; inset: auto 0 0 0; height: 3px; background: rgba(0,0,0,.2); }
.thumb .prog i { display: block; height: 100%; background: var(--primary); width: 0; }

/* ---------- 个人主页 ---------- */
.profile-card { overflow: hidden; }
/* 封面：图片「按宽度完整显示」，左右永不裁切。
   以前是 background-size: cover + 固定 108px，容器比图扁，图被上下切掉大半；
   App 端又是另一种比例，同一张图两端看到的根本不是同一个画面。
   现在两层：底层同图模糊铺满补足多余空间，上层按图片自身比例完整摆放。 */
.profile-cover {
  position: relative;
  overflow: hidden;
  height: 168px;                       /* 不支持 aspect-ratio 时的兜底 */
  background: #1f2937;
}
@supports (aspect-ratio: 1 / 1) {
  .profile-cover {
    height: auto;
    /* width 必须显式写：只有 aspect-ratio + max-height 时，高度被 220px 钳制后
       宽度会按比例倒推成 330px，右侧露出白条。写上 100% 后 max-height 只影响高度。 */
    width: 100%;
    aspect-ratio: 1.5 / 1;             /* 与 App 端 COVER_ASPECT、服务端裁剪比例一致 */
    max-height: 220px;                 /* 桌面宽容器下别把封面撑成一整屏 */
  }
}
.profile-cover .pc-blur {
  position: absolute; inset: -14px;
  background-size: cover;
  background-position: center;
  filter: blur(16px) brightness(.6);
  transform: scale(1.08);
}
.profile-cover .pc-full {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  /* 100% auto = 宽度铺满、高度按图片自身比例 —— 一张完整、不裁左右的图 */
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
}
.cover-aurora { background: linear-gradient(120deg, #3b6cf6, #7c5cff); }
.cover-sunset { background: linear-gradient(120deg, #ff8a5c, #ff5c8a); }
.cover-mint { background: linear-gradient(120deg, #12a594, #4ade80); }
.cover-dusk { background: linear-gradient(120deg, #2b3a67, #6b7280); }
.cover-sand { background: linear-gradient(120deg, #d9a441, #f0c987); }
.cover-ink { background: linear-gradient(120deg, #1f2937, #4b5563); }
.profile-body { padding: 0 20px 18px; }
/* 头像上移 30px 靠负 margin 实现，而 .profile-cover 是定位元素（position: relative）。
   定位元素与静态元素同层时，定位元素绘制在上 —— 封面会盖住头像顶部 30px。
   把 .profile-top 也提成定位元素并给 z-index，保证头像压在封面之上。 */
.profile-top { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 14px; margin-top: -30px; }
.profile-top .avatar { border: 3px solid var(--card); width: 76px; height: 76px; font-size: 26px; }
.profile-top .actions { margin-left: auto; padding-bottom: 4px; display: flex; gap: 8px; }
.profile-name { font-size: 19px; font-weight: 600; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.profile-sign { color: var(--muted); font-size: 14px; margin-top: 4px; }
.profile-loc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.profile-stats { display: flex; gap: 22px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.profile-stats b { display: block; font-size: 16px; color: var(--text); font-weight: 600; }

.visitor-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.visitor-item:last-child { border-bottom: none; }

/* ---------- 消息 ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 420px; }
@media (max-width: 768px) { .chat { height: calc(100dvh - 120px); } }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 72%; padding: 9px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.bubble.mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
/* 每条消息的时间 / 已读状态（v1.5） */
.msg-row { display: flex; flex-direction: column; gap: 3px; max-width: 100%; }
.msg-row.mine { align-items: flex-end; }
.msg-row.theirs { align-items: flex-start; }
.b-meta { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 11px; color: var(--faint); }
.b-meta .b-state { color: var(--faint); }
.b-meta .b-state.read { color: var(--primary); }
.chat-input { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-end; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.chat-input textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; }

.conv { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.conv:hover { background: var(--bg); }
.conv .info { flex: 1; min-width: 0; }
.conv .info .n { font-size: 14.5px; font-weight: 500; display: flex; gap: 6px; align-items: center; }
.conv .info .m { font-size: 13px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .right { text-align: right; font-size: 12px; color: var(--faint); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; display: inline-block; }

/* ---------- 通知 ---------- */
.notice { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.notice.unread { background: var(--primary-soft); }
.notice .txt { flex: 1; font-size: 14px; }
.notice .txt .t { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ---------- 登录/注册 ---------- */
.auth-wrap { max-width: 420px; margin: 8vh auto 0; padding: 0 18px; }
.auth-card { padding: 28px; }
/* SEO 门面卡片：未登录时服务端直出的站点介绍，前端接管后被登录页覆盖。
   刻意复用 .auth-wrap / .auth-card 外壳，替换时几乎不跳动。 */
.seo-card .seo-p { color: var(--muted); font-size: 14px; line-height: 1.75; margin: 10px 0 0; }
.seo-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.seo-tags span { font-size: 12px; color: var(--muted); background: var(--line); border-radius: 999px; padding: 3px 9px; }
.seo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
/* 三个按钮在 390px 卡片里要能挤在一行：内宽约 298px，8px 间距 ×2 后每个 94px */
.seo-actions .btn { flex: 1 1 30%; min-width: 78px; padding-left: 8px; padding-right: 8px; text-align: center; }
.auth-title { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 18px; }

/* ---------- 搜索 ---------- */
.search-bar { display: flex; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.result-user { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
mark { background: rgba(255, 214, 0, .35); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- 后台 ---------- */
.admin-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; align-items: start; }
.admin-nav { position: sticky; top: 24px; display: grid; gap: 3px; }
.admin-nav a { padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--muted); cursor: pointer; }
.admin-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.admin-nav a:hover { color: var(--text); }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-head h2 { font-size: 18px; margin: 0; font-weight: 600; }
.panel { padding: 18px 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--bg); border-radius: 12px; padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 600; margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.check-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 14px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; padding: 16px 12px 90px; }
  .admin-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 8px; }
  .admin-nav a { white-space: nowrap; }
  .table .clip { max-width: 120px; }
}

/* ---------- 底部导航（手机） ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr); align-items: center;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10.5px; color: var(--faint); padding: 4px 0; position: relative;
}
.tabbar a.active { color: var(--primary); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar .plus span {
  width: 40px; height: 40px; border-radius: 13px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; margin-bottom: 1px;
}
.tabbar .plus svg { width: 22px; height: 22px; }
.tabbar .dot {
  position: absolute; top: 2px; right: 50%; margin-right: -18px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 9.5px; line-height: 15px; text-align: center;
}
@media (max-width: 768px) { .tabbar { display: grid; } }

.mobile-head { display: none; }
@media (max-width: 768px) {
  .mobile-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 40;
  }
  .mobile-head .brand { padding: 0; font-size: 16px; }
  .mobile-head .brand-mark { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
}

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12, 16, 24, .45);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 18px;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border-radius: 16px; width: 100%; max-width: 420px;
  padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  max-height: 86vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 14px; font-size: 17px; font-weight: 600; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 300; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  background: rgba(22, 26, 35, .92); color: #fff; padding: 9px 16px;
  border-radius: 10px; font-size: 13.5px; animation: up .2s ease;
}
@keyframes up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 看图时锁住背景：只在灯箱内允许双指缩放，单指滑动交给脚本翻页，
   否则手机上一滑就把底下的页面滚走，关图后直接回到顶部 */
body.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .92); z-index: 400;
  display: flex; align-items: center; justify-content: center;
  touch-action: pinch-zoom; overscroll-behavior: contain;
}
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox .close { position: absolute; top: 18px; right: 20px; color: #fff; font-size: 26px; cursor: pointer; background: none; border: none; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 32px; cursor: pointer; background: none; border: none; padding: 10px 16px; }
.lightbox .nav.prev { left: 8px; }
.lightbox .nav.next { right: 8px; }
.lightbox .counter { position: absolute; bottom: 24px; color: rgba(255,255,255,.7); font-size: 13px; }

/* ---------- 头像裁剪（圆形取景） ---------- */
.crop-mask {
  position: fixed; inset: 0; z-index: 500; background: #0b0d12; color: #fff;
  display: flex; flex-direction: column;
  animation: fade .15s ease;
}
.crop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; font-size: 16px; font-weight: 500;
}
.crop-btn {
  background: none; border: none; color: #fff; font-size: 15px;
  padding: 6px 2px; cursor: pointer; font-family: inherit;
}
.crop-btn[data-crop="ok"] { color: #7ea2ff; font-weight: 600; }
.crop-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 10px 24px; min-height: 0;
}
.crop-frame {
  position: relative; width: min(76vw, 360px, 62vh); aspect-ratio: 1; flex: none;
}
.crop-frame canvas {
  width: 100%; height: 100%; display: block; cursor: grab; touch-action: none;
  background: #15181f; border-radius: 4px;
}
.crop-frame canvas:active { cursor: grabbing; }
/* 圆环 + 超大投影把圆外压暗，圆内就是最终头像 */
.crop-ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58);
  border: 2px solid rgba(255, 255, 255, .92);
}
.crop-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
  font-size: 12.5px; color: rgba(255, 255, 255, .62);
}

/* ---------- 名片改版 ---------- */
.profile-name .age {
  font-size: 13px; font-weight: 400; color: var(--muted);
  background: var(--bg); border-radius: 7px; padding: 1px 7px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 12px; color: var(--primary);
  background: var(--primary-soft); border-radius: 7px; padding: 2px 9px;
}
.profile-stats > div.clickable { cursor: pointer; }
.profile-stats > div.clickable:hover b { color: var(--primary); }
.profile-foot { margin-top: 14px; display: flex; justify-content: flex-end; }

.tab-badge { display: none; }
.tab-badge.on {
  display: inline-block; min-width: 16px; height: 16px; padding: 0 4px;
  margin-left: 3px; border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10.5px; line-height: 16px; text-align: center; vertical-align: 1px;
}

.switch-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.switch-row:last-child { border-bottom: none; }
.switch-row > div { flex: 1; min-width: 0; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: 0 0 44px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 13px;
  background: var(--line); transition: background .2s; cursor: pointer;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s;
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .field { margin-bottom: 12px; }
.form-grid .input, .form-grid .select { padding: 8px 10px; font-size: 14px; }
.modal { max-width: 470px; }

.kv { display: grid; gap: 1px; }
.kv-row {
  display: flex; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.kv-row:last-child { border-bottom: none; }
.kv-row span { width: 64px; flex: 0 0 64px; color: var(--muted); font-size: 13px; }
.kv-row b { font-weight: 500; }
.bio {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--text); line-height: 1.7; white-space: pre-wrap;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.avatar-edit { position: relative; cursor: pointer; }
.avatar-edit .cam {
  position: absolute; right: -4px; bottom: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card);
}
@media (max-width: 420px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- 设置页 ---------- */
.avatar.xl { width: 96px; height: 96px; font-size: 34px; }
.setting-list { margin-top: 8px; }
.setting-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 2px; border-bottom: 1px solid var(--line);
  cursor: pointer; font-size: 14px;
}
.setting-item:last-child { border-bottom: none; }
.setting-item:hover .lbl { color: var(--primary); }
.setting-item .lbl { font-weight: 500; }
.setting-item .val {
  color: var(--muted); font-size: 13.5px; max-width: 55%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.setting-item .chev { color: var(--faint); font-style: normal; font-size: 18px; line-height: 1; }
.setting-item .avatar { pointer-events: none; }

.notice-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg); font-size: 13px; color: var(--muted);
}
.profile-sign.clickable { cursor: pointer; border-radius: 6px; }
.profile-sign.clickable:hover { color: var(--primary); background: var(--primary-soft); }

/* ---------- 消息中心 ---------- */
/* 首页 tab 栏右上角的刷新按钮 */
.feed-tabs { align-items: center; padding: 0 12px 0 18px; }
.feed-tabs .spacer { flex: 1; }
.feed-tabs .feed-refresh {
  padding: 7px; margin: 0 0 6px; border: none; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer; line-height: 0;
}
.feed-tabs .feed-refresh:hover { color: var(--primary); background: var(--bg); }
.feed-tabs .feed-refresh:disabled { opacity: .6; cursor: default; }
.feed-tabs .feed-refresh.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 六个分类等宽平铺：桌面 6 格一行，手机 3 列 × 2 行 */
.inbox-tabs {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
  padding: 12px; border-bottom: 1px solid var(--line);
}
.inbox-tabs > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  margin: 0; padding: 11px 4px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inbox-tabs > button:hover { color: var(--text); border-color: var(--primary); }
.inbox-tabs > button.active {
  border-color: var(--primary); background: var(--primary-soft);
  color: var(--primary); font-weight: 500;
}
@media (max-width: 768px) {
  .inbox-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .inbox-tabs > button { padding: 12px 2px; font-size: 13px; }
}

.conv-group {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 18px 7px; font-size: 12.5px; color: var(--muted);
  background: var(--bg); font-weight: 500;
}
.conv-group em {
  font-style: normal; background: var(--line); color: var(--muted);
  border-radius: 8px; padding: 0 6px; font-size: 11px; line-height: 16px;
}
.conv-group i {
  font-style: normal; font-weight: 400; font-size: 11.5px;
  color: var(--faint); margin-left: auto;
}
.conv-flag {
  font-size: 10.5px; font-weight: 400; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 0 4px; line-height: 15px; flex: 0 0 auto;
}
.conv-pin {
  font-size: 10.5px; font-weight: 500; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 4px;
  padding: 0 4px; line-height: 15px; flex: 0 0 auto;
}

/* ---------- 聊天：陌生人提示 ---------- */
.chat-tip {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 14px 10px; padding: 9px 12px; border-radius: 10px;
  background: var(--primary-soft); color: var(--muted);
  font-size: 12.5px; line-height: 1.6;
}
.chat-tip svg { flex: 0 0 auto; margin-top: 2px; color: var(--primary); }

.chat-locked {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 20px 16px; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 13px; text-align: center;
}

/* ---------- 帖子可见范围 ---------- */
.select-sm { padding: 7px 30px 7px 10px; font-size: 13.5px; width: auto; max-width: 45%; }
.vis-note {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 18px; font-size: 12.5px; color: var(--muted);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.vis-note svg { color: var(--faint); flex: 0 0 auto; }

/* ---------- 标签 ---------- */
.hashtag { color: var(--primary); text-decoration: none; font-weight: 500; }
.hashtag:hover { text-decoration: underline; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; line-height: 1.6; text-decoration: none;
  border: 0; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.tag-pill:hover { filter: brightness(.96); }
.tag-pill i { font-style: normal; font-size: 11px; opacity: .65; }

/* 首页固定标签条 */
.tag-strip-inner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; }
.tag-strip-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--faint); margin-right: 2px;
}

/* 标签页头部 */
.tag-head { padding: 14px 18px 16px; }
.tag-head-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 20px; font-weight: 600; margin: 6px 0 4px;
}
.tag-head-title svg { color: var(--primary); }

/* 发帖 / 编辑页的标签条 */
.tag-bar { margin-top: 10px; }
.tag-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px;
}
.tag-chip i {
  cursor: pointer; font-style: normal; font-size: 14px;
  line-height: 1; opacity: .5; padding: 0 1px;
}
.tag-chip i:hover { opacity: 1; color: var(--danger); }
.tag-warn { margin-top: 6px; font-size: 12px; color: #d97706; }
.tag-sug { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-empty { font-size: 12px; color: var(--faint); }
.tag-empty b { font-weight: 600; color: var(--muted); }

/* 粉丝 / 关注列表 */
.flist-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.flist-row:last-child { border-bottom: none; }
.fname { font-weight: 500; color: var(--text); text-decoration: none; }
.fname:hover { color: var(--primary); }

.result-label { padding: 14px 18px 4px; font-size: 12.5px; color: var(--muted); }
.clickable { cursor: pointer; }
.profile-stats .clickable:hover { color: var(--primary); }

/* ---------- 收尾微调 ---------- */
.profile-stats { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 480px) { .profile-stats { gap: 14px; } }
/* 没固定标签时，首页第一张卡片不要多出空隙 */
.tag-strip.hidden + .card { margin-top: 0; }

/* ================= v1.5.0 ================= */

/* 性别标识（D12：填了就显示，保密不显示；员工组不下发） */
.g-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 5px; border-radius: 50%;
  font-size: 11px; line-height: 1; vertical-align: 1px;
}
.g-badge.male { color: #2a6ff0; background: rgba(58, 124, 246, .13); }
.g-badge.female { color: #e0559a; background: rgba(224, 85, 154, .13); }

/* 在线小绿点 */
.online-dot {
  display: inline-block; width: 6px; height: 6px; margin-right: 4px;
  border-radius: 50%; background: var(--ok); vertical-align: 1px;
}

/* 可见范围胶囊：发帖页 + 修改弹窗共用 */
.vis-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vis-pills button {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 13px; font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.vis-pills button:hover { border-color: var(--primary); color: var(--primary); }
.vis-pills button.on {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-soft); font-weight: 500;
}

/* 帖子时间行上的可见范围小标签 */
.vis-tag {
  padding: 1px 6px; border-radius: 6px; font-size: 11px;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line);
}

/* 后台：私密内容占位行 */
.mask-row { color: var(--faint); font-style: normal; letter-spacing: .5px; }

/* 设置页「关于」里的反馈入口 */
.setting-item .lbl { flex-shrink: 0; }

/* 反馈弹窗 */
#fb-content { min-height: 110px; }
#fb-contact { margin-top: 8px; }

/* 后台反馈列表 */
.fb-row { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.fb-row:last-child { border-bottom: none; }
.fb-row .fb-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.fb-row .fb-body { margin: 8px 0; font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.fb-row .fb-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-row.done { opacity: .62; }

/* 消息页「未读优先」切换条 */
.unread-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; margin: 0 0 2px;
  font-size: 12.5px; color: var(--muted);
  background: var(--primary-soft); border-radius: 8px;
}
.unread-bar .link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; font-size: 12.5px; font-family: inherit; }
.unread-bar .link:hover { text-decoration: underline; }

/* 注册筛查问卷 */
.quiz-intro { font-size: 12.5px; color: var(--muted); margin: 6px 0 8px; }
.quiz-q { padding: 10px 0; border-bottom: 1px solid var(--line); }
.quiz-q .q-t { font-weight: 500; margin-bottom: 6px; font-size: 13.5px; }
.quiz-opt { display: flex; align-items: flex-start; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.quiz-opt:hover { background: var(--bg); }
.quiz-opt input { margin-top: 2px; }

/* 首页右下角悬浮球（必读） */
.float-ball {
  position: fixed; right: 18px; bottom: 78px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .2);
  transition: transform .25s, opacity .25s;
}
.float-ball svg { width: 20px; height: 20px; }
.float-ball.hide { opacity: 0; transform: translateY(24px); pointer-events: none; }

/* ===== 移动端 / App 内（WebView）适配 ===== */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
/* 点按不要灰块，顺带去掉移动端的 300ms 点击延迟 */
button, a, .btn, .icon-btn, .tabbar a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* 界面控件不参与选中，正文保持可复制 */
.btn, .icon-btn, .tabbar, .nav, .admin-nav, .compose-tools, .poll-opt { -webkit-user-select: none; user-select: none; }
.post-body, .txt, .bubble, .comment .txt { -webkit-user-select: text; user-select: text; }

@media (max-width: 768px) {
  /* 全面屏手势条：Toast 与悬浮球别压在条上 */
  .toast-root { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .float-ball { bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* 评论三点菜单可能超出屏幕，允许内部滚动 */
  .c-menu { max-height: 60vh; overflow-y: auto; }
}

/* App 内：关掉浏览器式下拉刷新与回弹观感 */
html.in-app, html.in-app body { overscroll-behavior: none; }

/* @ 提及：可点击跳转对方主页，给个明确的可点样式 */
.mention {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.mention:hover { text-decoration: underline; }

/* ===== v1.16.0：私信发图/视频、引用、评论配图 ===== */

/* 气泡里的图片与视频 */
.bubble .msg-media { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.bubble .msg-media img,
.bubble .msg-media video { display: block; width: 100%; max-width: 220px; border-radius: 10px; }
.bubble .msg-media video { max-height: 260px; background: #000; }
/* 语音条：和微信一样固定宽度，不跟随气泡拉满 */
.bubble .msg-media audio { display: block; width: 220px; max-width: 100%; height: 40px; }
.bubble .b-text + .msg-media { margin-top: 6px; }

/* 引用块 */
.b-quote {
  font-size: 12.5px; line-height: 1.5; padding: 5px 8px; margin-bottom: 5px;
  border-left: 3px solid currentColor; border-radius: 5px;
  opacity: .82; cursor: pointer; word-break: break-word;
}
.bubble.mine .b-quote { background: rgba(255, 255, 255, .18); }
.bubble.theirs .b-quote { background: rgba(0, 0, 0, .05); }
.b-quote .bq-who { font-weight: 500; }

/* 「引用」「撤回」小按钮 */
.b-meta .b-reply,
.b-meta .b-recall {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--faint);
}
.b-meta .b-reply:hover { color: var(--primary); }
.b-meta .b-recall:hover { color: var(--danger); }

/* 已撤回的气泡 */
.bubble.recalled { background: transparent; border: 1px dashed var(--line); color: var(--faint); }
.bubble.recalled .b-recalled { font-size: 13px; font-style: italic; color: var(--faint); }

/* 附件栏：引用提示 + 待发媒体 */
.chat-attach { padding: 0 14px; }
.chat-attach.empty { display: none; }
.attach-quote {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  padding: 6px 10px; border-left: 3px solid var(--primary);
  background: var(--primary-soft); border-radius: 6px; font-size: 12.5px;
}
.attach-quote span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attach-media.empty { display: none; }
.am-item { position: relative; width: 58px; height: 58px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.am-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.am-video {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 12px; color: var(--muted); background: var(--line);
}
.am-del {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 16px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 13px; cursor: pointer; padding: 0;
}

/* 评论里的图片 */
.cm-media { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cm-media img, .cm-media video { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; display: block; }
.cm-media video { background: #000; }

/* 评论输入区的选图按钮 */
#cm-pick { color: var(--muted); }
