/* =========================================================
   论坛前端 · 全局样式
   设计语言沿用 Axure 原型（luntan）：
   - 灰白系 + 唯一强调色 #169BD5
   - 选中态 = 蓝色 + 下划线（原型注释规则）
   - 帖子卡：有图放预览图，没图文本框扩大（原型注释规则）
   - 横屏三栏（功能区 + 内容 + 热点区），竖屏单列 + 汉堡抽屉
   ========================================================= */

:root {
  --panel: #f5f5f5;          /* 原型功能区/热点区底色 */
  --bg: #f7f8fa;
  --card: #ffffff;
  --line: #e3e3e3;           /* 布局分隔线（原型 #D9D9D9 精修版） */
  --line-strong: #d0d0d0;
  --line-soft: #f0f0f0;
  --text: #333333;           /* 原型正文色 */
  --text-strong: #111111;
  --text-sub: #8a8a8a;
  --accent: #169bd5;         /* 原型唯一强调色 */
  --accent-deep: #1288bd;
  --accent-weak: rgba(22, 155, 213, 0.09);
  --danger: #e5645a;
  --like: #e0245e;           /* 点赞红：爱心专用的第二强调色（约定例外） */
  --radius-card: 10px;
  --radius-btn: 8px;
  --shadow-card: 0 1px 2px rgba(17, 17, 17, 0.04);
  --shadow-pop: 0 6px 24px rgba(17, 17, 17, 0.12);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
img { display: block; }
a { color: var(--accent); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 布局壳：横屏三栏 ---------- */
.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.app.has-hot { grid-template-columns: 232px minmax(0, 1fr) 304px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.page {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 24px 72px;
  flex: 1;
}
.page > :first-child { margin-top: 0; }

/* 顶栏：横屏隐藏（导航交给侧边栏） */
.topbar { display: none; }

/* ---------- 侧边栏（功能区） ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 1px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  display: block;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  background: none;
  border-radius: 8px;
  font-size: 15px;
  color: #4c4c4c;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
}
.nav-item svg { flex: none; color: #9a9a9a; transition: color 0.15s ease; }
.nav-item:hover { background: rgba(0, 0, 0, 0.05); color: var(--text-strong); }
.nav-item:hover svg { color: var(--text-sub); }
/* 原型规则：选中的字体为蓝色并有下划线 */
.nav-item.active { color: var(--accent); font-weight: 600; }
.nav-item.active svg { color: var(--accent); }
.nav-item.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 16px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0.42);
  transform-origin: left center;
}

/* ---------- 热点区（横屏仅广场/帖子详情显示） ---------- */
.hotrail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 22px 16px;
  overflow-y: auto;
}
.hot-title {
  margin: 2px 4px 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
}
/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 5px 3px 12px;
  margin-bottom: 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.search-field {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 8px 0;
}
.search-field::placeholder { color: #b5b5b5; }
.search-box .icon-btn { width: 30px; height: 30px; color: var(--accent); }
.search-box .icon-btn:hover { background: var(--accent-weak); color: var(--accent-deep); }
/* 搜索类型切换（帖子/用户） */
.search-type { display: flex; gap: 8px; margin: 10px 0 2px; }
.stype {
  flex: 1;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.stype:hover { color: var(--text-strong); }
.stype.on { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); font-weight: 600; }
/* 用户搜索结果行 */
.user-row > .ico { color: #c0c0c0; flex: none; }
.hot-sub {
  margin: 0 4px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-strong);
}
.kw-heat { flex: none; margin-left: auto; font-size: 12px; color: var(--text-sub); }
.hot-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.hot-item:hover { background: #fff; }
.hot-rank {
  flex: none;
  width: 22px;
  font-size: 15px;
  font-weight: 700;
  color: #b5b5b5;
  text-align: center;
  line-height: 20px;
}
.hot-item.top .hot-rank { color: var(--accent); }
.hot-main { min-width: 0; flex: 1; }
/* 原型规则：热点帖子字数多了用省略号 */
.hot-name {
  display: block;
  font-size: 14px;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-item:hover .hot-name { color: var(--accent); }
.hot-heat { display: block; margin-top: 3px; font-size: 12px; color: var(--text-sub); }

/* ---------- 通用卡片 / 按钮 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn-danger:hover { background: #d4544b; border-color: #d4544b; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: #555; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn[disabled]:active { transform: none; }
.btn svg { flex: none; }
.btn-sm { padding: 6px 13px; font-size: 13px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #555;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-strong); }

/* ---------- 页签（全部/关注） ---------- */
/* 原型规则：选中的字体为蓝色并有下划线 */
.tabs { display: flex; gap: 30px; }
.tab {
  position: relative;
  padding: 13px 2px 11px;
  border: 0;
  background: none;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  transition: color 0.15s ease;
}
.tab:hover { color: var(--text-strong); }
.tab.active { color: var(--accent); font-weight: 600; }
.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.tab.active::after { transform: scaleX(1); }

.tabs-bar {
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 24px;
}

/* 搜索结果条（广场页搜索态） */
.search-result-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  margin-bottom: 14px;
}
.sr-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text);
}
.sr-text b { color: var(--accent); }
.sr-count { flex: none; font-size: 13px; color: var(--text-sub); }
.search-result-bar .btn-sm { margin-left: auto; flex: none; }

/* 搜索页（竖屏抽屉入口） */
.search-page { padding: 16px 18px; }
.search-page .search-box { margin-bottom: 2px; }
.search-page .hot-sub { margin-top: 14px; }
.search-page .hot-item:hover { background: var(--panel); }
.sp-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-sub);
}
.sp-meta b { color: var(--accent); }
.sp-meta .btn-sm { margin-left: auto; flex: none; }
.sp-results .post-card { margin-top: 12px; }

/* ---------- 帖子卡片 ---------- */
.post-card { padding: 15px 18px 12px; margin-bottom: 14px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.post-card:hover { border-color: var(--line); box-shadow: 0 3px 12px rgba(17, 17, 17, 0.06); }
.pc-head { display: flex; align-items: center; gap: 12px; }
.pc-name { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.pc-meta { margin-top: 2px; font-size: 12px; color: var(--text-sub); }
.pc-title {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.5;
}
.pc-text { margin-top: 6px; font-size: 14px; line-height: 1.68; color: var(--text); }
/* 原型规则：字数多了记得用省略号 */
.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* 原型规则：没图片时文本框扩大（占用图片区域） */
.clamp-6 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}
.pc-imgs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pc-imgs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  cursor: zoom-in;
}
.pc-imgs.solo img { aspect-ratio: 16 / 9; }
.pc-imgs.duo img { aspect-ratio: 4 / 3; }
.pc-actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0;
  background: none;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.act:hover { background: var(--accent-weak); color: var(--accent); }
.act svg { flex: none; }
/* 点赞/收藏选中：填充强调色 */
.act.on { color: var(--accent); font-weight: 600; }
/* 选中后图标变实心，颜色跟随文字 */
.act.on svg { fill: currentColor; }
/* 点赞选中用红色爱心 */
.act-like.on { color: var(--like); }
/* 收藏选中用金黄色 */
.act-fav.on { color: #f7b500; }
.act.pop svg { animation: pop 0.3s ease; }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.act-detail { margin-left: auto; }
.act-detail:hover { color: var(--accent); background: var(--accent-weak); }

/* 头像 */
.avatar {
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

/* ---------- 帖子详情 ---------- */
.detail-card { padding: 20px 22px; }
.d-title { margin: 14px 0 0; font-size: 19px; font-weight: 700; color: var(--text-strong); line-height: 1.45; }
.d-body { margin-top: 10px; font-size: 15px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.d-imgs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.d-imgs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  cursor: zoom-in;
}
.d-imgs.solo img { aspect-ratio: 16 / 9; }
.d-actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 6px;
}
.d-actions .act-danger:hover { background: rgba(229, 100, 90, 0.08); color: var(--danger); }

/* 评论区 */
.cmt-section { margin-top: 14px; padding: 16px 22px 20px; }
.cmt-title { margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--text-strong); }
.cmt-input { display: flex; gap: 10px; align-items: flex-start; }
.cmt-field {
  flex: 1;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  resize: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cmt-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.cmt-list { margin-top: 6px; }
.cmt-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.cmt-item:last-child { border-bottom: 0; }
.cmt-body { min-width: 0; flex: 1; }
.cmt-name { font-size: 13px; font-weight: 700; color: var(--text-strong); }
.cmt-time { margin-left: 8px; font-size: 12px; color: var(--text-sub); font-weight: 400; }
.cmt-text { margin-top: 4px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

/* ---------- 发帖 ---------- */
.compose-card { padding: 20px 22px; }
.compose-card h1 { margin: 0 0 16px; font-size: 18px; font-weight: 700; color: var(--text-strong); }
.field {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.field-title { font-size: 15px; font-weight: 600; }
textarea.field { resize: none; overflow: hidden; min-height: 140px; }
.field-wrap { margin-top: 14px; }
.compose-tip { margin-top: 8px; font-size: 12px; color: var(--text-sub); }
.img-pick-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.img-pick {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.img-pick img { width: 100%; height: 100%; object-fit: cover; }
.img-pick .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.compose-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.compose-foot .spacer { flex: 1; }

/* ---------- 消息 ---------- */
.msgs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card);
  background: #fff;
  min-height: 520px;
}
.friend-list { background: var(--panel); border-right: 1px solid var(--line); padding: 10px; overflow-y: auto; max-height: 76vh; }
.friend-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
  position: relative;
}
.friend-item:hover { background: #fff; }
.friend-item.active { background: #fff; box-shadow: var(--shadow-card); }
.friend-item.active .f-name { color: var(--accent); }
.f-main { min-width: 0; flex: 1; }
.f-row1 { display: flex; align-items: baseline; gap: 8px; }
.f-name { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.f-time { margin-left: auto; font-size: 11px; color: var(--text-sub); }
.f-last {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f-badge {
  position: absolute;
  left: 44px;
  top: 12px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.chat-pane { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
}
.chat-back { display: none; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 60vh; min-height: 320px; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.bubble-row.me { flex-direction: row-reverse; }
.bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.them { background: var(--panel); border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; color: var(--text); }
.bubble.me { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble-time { font-size: 11px; color: var(--text-sub); flex: none; }
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  align-items: flex-end;
}
.chat-field {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }

/* ---------- 我的 / 用户主页 ---------- */
.profile-head { padding: 22px; display: flex; align-items: center; gap: 16px; }
.profile-name { font-size: 18px; font-weight: 700; color: var(--text-strong); }
.profile-bio { margin-top: 4px; font-size: 13px; color: var(--text-sub); }
.profile-stats { margin-top: 6px; font-size: 13px; color: var(--text-sub); display: flex; gap: 14px; }
.profile-stats b { color: var(--text-strong); font-weight: 700; }
.profile-edit-btn, .profile-actions, .profile-btns { margin-left: auto; flex: none; }
.profile-actions { display: flex; gap: 10px; }
.profile-btns { display: flex; gap: 10px; }
.logout-btn-header:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(229, 100, 90, 0.08);
}

/* ---------- 管理后台 ---------- */
.admin-pad { padding: 18px 20px; }
.admin-note { margin: 0 2px 12px; font-size: 12px; color: var(--text-sub); }
.admin-note b { color: var(--accent); }
.admin-sec-head { display: flex; align-items: center; gap: 12px; }
.admin-acts { display: inline-flex; gap: 8px; flex: none; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  flex: none;
  vertical-align: 1px;
}
.badge-pending { color: var(--accent); background: var(--accent-weak); }
.badge-muted { color: var(--text-sub); background: var(--panel); }
.badge-admin { color: var(--accent); background: var(--accent-weak); }
.badge-super { color: #a76f00; background: rgba(247, 181, 0, 0.15); }
.badge-banned { color: var(--danger); background: rgba(229, 100, 90, 0.1); }
.ban-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(229, 100, 90, 0.08);
}
.invite-code { letter-spacing: 0.5px; }
.reset-pass-box {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
}
.reset-pass-box .invite-code { font-size: 16px; font-weight: 700; color: var(--text-strong); }

/* ---------- 帮助我们 ---------- */
.help-card { padding: 24px 26px 20px; max-width: 640px; }
.help-title { margin: 0 0 6px; font-size: 19px; font-weight: 700; color: var(--text-strong); }
.help-sub { margin: 22px 0 0; font-size: 15px; font-weight: 700; color: var(--text-strong); }
.help-text { margin: 8px 0 0; font-size: 14px; line-height: 1.75; color: var(--text); }
.qq-box {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-weak);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.qq-box:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.qq-num { font-weight: 700; font-size: 16px; color: var(--accent-deep); letter-spacing: 0.5px; }
.qq-box svg { margin-left: auto; color: var(--accent); }
.help-thanks { margin: 16px 0 0; font-size: 12px; color: var(--text-sub); }
.blocked-banner {
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid rgba(229, 100, 90, 0.28);
  border-radius: 8px;
  background: rgba(229, 100, 90, 0.08);
  color: var(--danger);
  font-size: 13px;
}

/* 可点击的用户（帖子/评论/列表里的头像与昵称） */
.pc-user { cursor: pointer; }
img.pc-user:hover { opacity: 0.85; }
.pc-user:hover .pc-name, .cmt-name.pc-user:hover { color: var(--accent); }

/* 社交入口磁贴 */
.social-tiles {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.social-tile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.social-tile:hover { border-color: var(--line); box-shadow: 0 3px 12px rgba(17, 17, 17, 0.06); transform: translateY(-1px); }
.st-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--accent-weak);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}
.st-main { min-width: 0; }
.st-label { display: block; font-size: 14px; font-weight: 700; color: var(--text-strong); }
.st-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-count { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 700; color: var(--accent); }
.st-count svg { color: #c0c0c0; }
/* 收藏磁贴：星星用金黄 */
.social-tile.st-gold .st-icon { color: var(--fav-gold, #f7b500); background: rgba(247, 181, 0, 0.12); }
.social-tile.st-gold .st-count { color: #f7b500; }

/* 用户列表（关注/粉丝/黑名单） */
.list-card { padding: 4px 0; }
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.user-row:last-child { border-bottom: 0; }
.user-row-main { min-width: 0; flex: 1; }
.ur-name { font-size: 14px; font-weight: 700; color: var(--text-strong); }
.user-row-main:hover .ur-name { color: var(--accent); }
.ur-bio {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-row .btn { flex: none; }
#chatName[data-user] { cursor: pointer; }
#chatName[data-user]:hover { color: var(--accent); }

/* 编辑资料弹窗 */
.f-label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--text-sub); }
.f-label:first-of-type { margin-top: 4px; }
.pf-avatar-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.pf-avatar-tip { margin-top: 6px; font-size: 12px; color: var(--text-sub); }

/* ---------- 登录 / 注册 ---------- */
.app.auth-mode { grid-template-columns: minmax(0, 1fr); }
.app.auth-mode .sidebar,
.app.auth-mode .hotrail,
.app.auth-mode .topbar,
.app.auth-mode .drawer-btn { display: none !important; }
.auth-wrap { max-width: 400px; margin: 48px auto 72px; padding: 0 16px; }
.auth-card { padding: 26px 26px 22px; }
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 4px;
}
.auth-tabs { justify-content: center; margin-bottom: 6px; }
.auth-form .btn-block { width: 100%; margin-top: 18px; }
.field-err { margin-top: 8px; font-size: 12px; color: var(--danger); }
.field.invalid { border-color: var(--danger); }
.field.invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(229, 100, 90, 0.09);
}
.auth-tip { margin-top: 12px; text-align: center; font-size: 12px; color: var(--text-sub); }
.section-gap { margin-top: 22px; }
.section-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--text-strong); }

/* ---------- 空状态 ---------- */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-sub);
}
.empty svg { margin: 0 auto 10px; color: #c9c9c9; }
.empty p { margin: 0; font-size: 13px; }

/* ---------- 竖屏抽屉 ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.drawer-mask.show { opacity: 1; }
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(78vw, 300px);
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 41;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateX(-102%);
  transition: transform 0.24s ease;
  box-shadow: var(--shadow-pop);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 14px; }
.drawer-head .brand { padding: 0; }
.drawer .nav-item.active::after { transform: scaleX(0.34); }

/* ---------- Toast / Modal ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(17, 17, 17, 0.85);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-mask.show { opacity: 1; }
.modal-card {
  width: min(92vw, 380px);
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-pop);
  transform: translateY(8px);
  transition: transform 0.2s ease;
}
.modal-mask.show .modal-card { transform: translateY(0); }
.modal-card h3 { margin: 0 0 14px; font-size: 16px; color: var(--text-strong); }
.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: none;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.radio-row:hover { background: var(--panel); }
.radio-row .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.6px solid #bbb;
  flex: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.radio-row.sel { color: var(--text-strong); font-weight: 600; }
.radio-row.sel .dot { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent); }
.modal-foot { margin-top: 16px; display: flex; justify-content: flex-end; gap: 10px; }

/* 图片放大遮罩 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 70;
  display: grid;
  place-items: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lightbox.show { opacity: 1; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; }

/* =========================================================
   竖屏（手机端）：单列 + 顶栏 + 汉堡抽屉
   原型 shuping 版结构；窗口过窄的桌面端同样收纳
   ========================================================= */
@media (orientation: portrait), (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app.has-hot { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .hotrail { display: none; }
  .page { padding: 14px 14px 72px; max-width: none; }

  .topbar {
    display: flex;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    border-bottom: 1px solid var(--line-soft);
    padding: 6px 10px;
    min-height: 52px;
  }
  .drawer-btn { display: inline-grid; }
  .topbar-title { font-size: 16px; font-weight: 700; color: var(--text-strong); }
  .topbar-tabs { flex: 1; display: flex; justify-content: center; min-width: 0; }
  .topbar-tabs .tabs { gap: 24px; }
  /* 竖屏时页签移到顶栏，页面内不再重复显示 */
  .page .tabs-bar { display: none; }

  .msgs-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .friend-list { max-height: none; border-right: 0; }
  .msgs-layout.chat-open .friend-list { display: none; }
  .msgs-layout:not(.chat-open) .chat-pane { display: none; }
  .chat-back { display: inline-grid; }
  .chat-body { max-height: none; min-height: 56vh; }

  .img-pick-grid { grid-template-columns: repeat(3, 1fr); }
  .compose-foot { flex-wrap: wrap; }
  /* 窄屏社交磁贴改单列全宽，避免挤压 */
  .social-tiles { grid-template-columns: 1fr; gap: 10px; }
  /* 窄屏资料卡：信息与按钮分两行，中间列不再被挤扁 */
  .profile-head { flex-wrap: wrap; }
  .profile-head > div { flex: 1 1 220px; min-width: 0; }
  .profile-stats { flex-wrap: wrap; row-gap: 4px; }
  /* 我的页统计竖排 */
  .stats-col { flex-direction: column; gap: 6px; align-items: flex-start; }
  .profile-btns { flex: 1 1 100%; margin-left: 0; margin-top: 2px; }
  .profile-btns .btn { flex: 1; justify-content: center; }
  .profile-actions { flex: 1 1 100%; margin-left: 0; margin-top: 2px; }
  .profile-actions .btn { flex: 1; }
}

/* 横屏时隐藏抽屉按钮与顶栏要素 */
@media (orientation: landscape) and (min-width: 861px) {
  .drawer-btn { display: none; }
  .chat-back { display: none !important; }
}

/* ---- 后端接入新增 ---- */
/* 表单辅助说明（如注册页用户名规则） */
.field-tip { margin-top: 6px; font-size: 12px; color: var(--text-sub); }
/* 主页 @用户名（昵称旁） */
.profile-username { margin-top: 2px; font-size: 13px; color: var(--text-sub); }
