/* ============================================
   红楼记事录 · 全局样式
   红砖红 / 米白 / 移动优先
   ============================================ */
:root {
  --primary: #8B3A3A;
  --primary-dark: #6E2C2C;
  --accent: #B22222;
  --bg: #F7F4EF;
  --card: #FFFFFF;
  --text: #2D2A26;
  --text-muted: #8A847C;
  --border: #E5DFD5;
  --success: #3E7C4F;
  --warning: #C98A1B;
  --danger: #B23A3A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

/* 全局禁止页面横向滚动：clip 不建立滚动容器，不影响顶部 sticky 导航；
   长表格/代码块等仍在各自容器内滚动（.table-wrap、pre）。 */
html { overflow-x: clip; }

body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
}

.main { flex: 1; }

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }

/* ---------- 桌面站 → 移动版提示条 ---------- */
/* 显示判定见 config/context_processors.py：仅"自己选了桌面版的手机用户"能看到。
   分隔线不能省：下面 .site-header 是 --primary 系渐变，两截同色相贴会糊成
   一条双倍高的标题栏（App 那边的提示条踩过这个坑）。 */
.mobile-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .24);
}

.mobile-hint-text {
  flex: 1;
}

.mobile-hint-go {
  flex: none;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
}

.mobile-hint-go:hover {
  background: rgba(255, 255, 255, .3);
}

.mobile-hint-close {
  flex: none;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  opacity: .85;
  cursor: pointer;
}

.mobile-hint-close:hover {
  opacity: 1;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(60, 30, 30, .18);
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.logo-img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: block;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  font-family: "Songti SC", "STSong", serif;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: rgba(255, 255, 255, .92);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 8px;
  transition: background .15s;
  white-space: nowrap;
}

.nav-links a:hover { background: rgba(255, 255, 255, .14); }

.nav-user-wrap { position: relative; }

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px 10px;
  border-radius: 8px;
  font-family: inherit;
  transition: background .15s;
}

.nav-user-btn:hover { background: rgba(255, 255, 255, .14); }

.nav-user {
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  white-space: nowrap;
  /* inline-flex 让用户名与称号徽章严格垂直居中（vertical-align:middle 会有 1px 下沉） */
  display: inline-flex;
  align-items: center;
}

.nav-caret {
  color: rgba(255, 255, 255, .7);
  font-size: 10px;
  transition: transform .2s;
}

.nav-user-wrap.open .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(45, 42, 38, .16);
  padding: 6px;
  z-index: 60;
}

.nav-dropdown a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-dropdown a:hover { background: #F7F0EA; color: var(--primary); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

/* ---------- 英雄横幅 ---------- */
.hero {
  background: linear-gradient(160deg, var(--primary) 0%, #A04A4A 55%, #C07070 100%);
  color: #fff;
  padding: 52px 16px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .35;
}

.hero h1 {
  position: relative;
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
  letter-spacing: 8px;
  font-weight: 700;
}

.hero p {
  position: relative;
  margin-top: 10px;
  font-size: 14px;
  letter-spacing: 4px;
  opacity: .92;
}

/* ---------- 布局容器 ---------- */
.container { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
.container-narrow { max-width: 520px; }
.container-wide { max-width: 1000px; }

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 22px; font-family: "Songti SC", "STSong", serif; letter-spacing: 2px; }
.page-head h2 { font-size: 18px; margin: 24px 0 12px; font-family: "Songti SC", "STSong", serif; }
.muted { color: var(--text-muted); font-size: 13px; }

/* ---------- 公告 ---------- */
.announcement {
  background: #FDF3E3;
  border: 1px solid #EED9B0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  font-size: 14px;
  align-items: flex-start;
  flex-direction: column;
}

.announcement-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--warning);
  color: #fff;
  border-radius: 4px;
  padding: 0 8px;
  min-width: 44px;
  font-size: 12px;
  line-height: 1;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px; /* 与文本行垂直中心对齐（文字行高 24.5px） */
}

.announcement-text { white-space: pre-line; } /* 公告支持换行（保留 \n，折叠多余空格） */

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 14px;
}

.mini-table th, .mini-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.mini-table th { color: var(--text-muted); font-weight: 600; }

/* ---------- 热门区块 ---------- */
.section-title {
  font-size: 18px;
  margin-bottom: 14px;
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.featured-section { margin-bottom: 8px; }

/* ---------- 时间线与卡片 ---------- */
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(45, 42, 38, .05);
}
/* 列表页卡片整卡可点击进详情；详情页/管理页卡片不生效 */
.post-card:not(.post-detail):not(.report-card) { cursor: pointer; }

.post-title { font-size: 18px; margin-bottom: 8px; font-family: "Songti SC", "STSong", serif; line-height: 1.5; }
.post-title a { color: var(--text); text-decoration: none; }
.post-title a:hover { color: var(--primary); }

.post-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.post-content { font-size: 15px; word-wrap: break-word; }
.post-content p { margin-bottom: 10px; }
.post-content ul,
.post-content ol {
  margin: 8px 0 10px;
  padding-left: 1.6em;
}
.post-content li { margin-bottom: 4px; }
.post-content li::marker { color: var(--primary); }
/* 图片：统一按屏幕高度比例限制——高度约一半屏（50vh）、宽度上限 70vh 随比例，横图不再撑满容器 */
.post-content img { display: block; max-width: min(100%, 70vh); max-height: 50vh; width: auto; height: auto; margin: 8px 0; border-radius: 8px; }
.post-content blockquote {
  border-left: 3px solid var(--primary);
  background: #FAF6F0;
  padding: 8px 14px;
  margin: 10px 0;
  color: #57504A;
  border-radius: 0 8px 8px 0;
}
.post-content pre {
  background: #2D2A26;
  color: #EDE7DC;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  margin: 10px 0;
}
.post-content code { background: #F1EDE4; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.post-content pre code { background: none; padding: 0; }
.post-content table { border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 6px 10px; }
.post-content hr { border: none; border-top: 1px dashed var(--border); margin: 14px 0; }

/* 首页/时间线长文自动折叠：过多时 clamp 到 N 行 + 展开/收起按钮。只作用于列表卡片，排除详情页(.post-detail) */
.post-card:not(.post-detail) .post-content { white-space: normal; }
.post-card:not(.post-detail) .post-content.clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.post-card:not(.post-detail) .post-content-more {
  display: inline-block;
  margin: 6px 0 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.post-card:not(.post-detail) .post-content-more:hover { text-decoration: underline; }

/* 详情页标签 chips：点击跳转搜索该标签 */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.post-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(139, 58, 58, 0.08);
  border: 1px solid rgba(139, 58, 58, 0.25);
  color: var(--primary);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
}
.post-tag:hover { background: rgba(139, 58, 58, 0.16); }

/* 话题广场（/tags/）：标签云，字号按话题热度分 1–5 档 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.tag-cloud-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(139, 58, 58, 0.08);
  border: 1px solid rgba(139, 58, 58, 0.25);
  color: var(--primary);
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.tag-cloud-item:hover { background: rgba(139, 58, 58, 0.16); transform: translateY(-1px); }
.tag-cloud-name { font-weight: 600; }
.tag-cloud-count { font-size: 12px; color: var(--text-muted); }
.tag-size-1 .tag-cloud-name { font-size: 14px; }
.tag-size-2 .tag-cloud-name { font-size: 16px; }
.tag-size-3 .tag-cloud-name { font-size: 18px; }
.tag-size-4 .tag-cloud-name { font-size: 21px; }
.tag-size-5 .tag-cloud-name { font-size: 25px; }
.tag-size-1 { padding: 4px 11px; }
.tag-size-5 { padding: 7px 17px; }

/* 投票帖：详情页投票区块（先投再看结果，作者与已投票者可见分布） */
.poll-box {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(139, 58, 58, 0.04);
}
.poll-head { font-weight: 600; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.poll-total { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.poll-option { margin: 10px 0; }
.poll-option-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.poll-option-count { flex-shrink: 0; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.poll-mine .poll-option-text { font-weight: 600; color: var(--primary); }
.poll-mine-mark { font-size: 12px; font-weight: 400; color: var(--primary); }
.poll-bar { height: 8px; border-radius: 999px; background: rgba(139, 58, 58, 0.1); margin-top: 5px; overflow: hidden; }
.poll-bar-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.4s ease; }
.poll-vote-btn {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 9px 14px;
  border: 1px solid rgba(139, 58, 58, 0.35);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.poll-vote-btn:hover { background: rgba(139, 58, 58, 0.08); border-color: var(--primary); }
.poll-option-plain {
  margin: 6px 0;
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-size: 15px;
}
.poll-hint { margin-top: 10px; font-size: 13px; }
.poll-box .poll-vote-btn.poll-voting { opacity: 0.6; pointer-events: none; }

/* 时间线卡片标题旁的投票徽标（post.poll_options 已在喂查询集 prefetch） */
.poll-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(139, 58, 58, 0.08);
  border: 1px solid rgba(139, 58, 58, 0.3);
  color: var(--primary);
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}

/* 网易云歌曲卡片：正文/评论贴 music.163.com 歌曲链接自动渲染，点击注入官方外链播放器 */
.ncm-song {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(139, 58, 58, 0.05);
  font-size: 14px;
  max-width: 100%;
}
.ncm-song-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.ncm-song-link:hover { text-decoration: underline; }
.ncm-song-note { font-size: 15px; }
.ncm-song-play {
  border: 1px solid rgba(139, 58, 58, 0.35);
  background: var(--card);
  color: var(--primary);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.ncm-song-play:hover { background: rgba(139, 58, 58, 0.1); }
.ncm-song-frame {
  display: block;
  width: 100%;
  max-width: 480px;
  border: 0;
  border-radius: 10px;
  margin: 6px 0;
}

.post-meta {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.post-detail .post-title { font-size: 22px; margin-bottom: 12px; }

.my-post-excerpt { font-size: 14px; color: #57504A; margin-top: 6px; }

.reject-reason {
  color: var(--danger);
  background: #FBF0EE;
  padding: 2px 10px;
  border-radius: 6px;
}

.post-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.view-count { font-size: 13px; color: var(--text-muted); }

/* 点赞：无按钮背景，IconPark like（爱心）空心/实心切换 + 点击小动画 */
.post-stats { display: inline-flex; align-items: center; gap: 12px; }
.like-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
  position: relative;
}
.like-btn:hover { color: var(--accent); }
.like-btn svg { width: 1.25em; height: 1.25em; flex: none; }
.like-btn .thumb-on { display: none; }
.like-btn.liked { color: var(--accent); }
.like-btn.liked .thumb-off { display: none; }
.like-btn.liked .thumb-on { display: inline-block; }
.post-comment {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.post-comment:hover { color: var(--accent); }
.post-comment svg { width: 1.15em; height: 1.15em; flex: none; }

/* 收藏书签：空心/实心切换（与点赞按钮同款去背景风格） */
.fav-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.fav-btn:hover { color: var(--accent); }
.fav-btn svg { width: 1.25em; height: 1.25em; flex: none; }
.fav-btn .bookmark-on { display: none; }
.fav-btn.favorited { color: var(--accent); }
.fav-btn.favorited .bookmark-off { display: none; }
.fav-btn.favorited .bookmark-on { display: inline-block; }

/* 点赞小动画：图标弹跳（thumb-pop）+ 扩散圆环（ring-pop），JS 仅在点击点赞时触发，
   初始已点赞态不会播放 */
@keyframes like-pop {
  0% { transform: scale(.5); }
  55% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.like-btn .thumb-on.thumb-pop { animation: like-pop .4s cubic-bezier(.3,1.4,.5,1); }
@keyframes like-ring {
  0% { transform: translate(-50%, -50%) scale(.5); opacity: .85; }
  100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; }
}
.like-btn.ring-pop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.7em;
  height: 1.7em;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: like-ring .5s ease-out;
}

/* ---------- 评论区 ---------- */
.comments { margin-top: 24px; }

.comments-title {
  font-size: 17px;
  margin-bottom: 12px;
  font-family: "Songti SC", "STSong", serif;
}

.comment-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.comment-author { font-size: 13px; color: var(--primary); font-weight: 600; }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-content { font-size: 14px; line-height: 1.7; }
/* 评论/回复里的有效 @提及：主色超链接指向用户资料页 */
.comment-mention {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.comment-mention:hover { text-decoration: underline; }

.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.comment-actions .like-btn { font-size: 13px; }
.comment-actions .report-toggle { margin-left: auto; }
/* 自己发的评论没有"举报"按钮，删除按钮补位靠右；编辑者看他人评论仍为"举报+删除"成组靠右 */
.comment-actions:not(:has(.report-toggle)) .comment-delete { margin-left: auto; }
.comment-actions .comment-delete { margin-top: 0; }

.comment-delete { margin-top: 6px; }

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.comment-form textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 16px; /* ≥16px 防止 iOS 聚焦自动放大 */
  font-family: inherit;
  resize: vertical;
  background: #FDFCFA;
}

.comment-form textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 58, 58, .12);
}

/* 评论字数计数（微信式）：textarea 下方右对齐小字 "123/500" */
.comment-count {
  align-self: flex-end;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  user-select: none;
}

.comment-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-img-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.comment-img-btn:hover { color: var(--primary); border-color: var(--primary); }
.comment-img-btn svg { width: 18px; height: 18px; }

.comment-form-row .btn { margin-left: auto; }

.comment-images-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.comment-images-preview img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* 评论图片网格：朋友圈式，最多 3 张一排，多图正方形缩略，超出第 3 格右下角 "+N" */
.comment-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 300px;
  margin-top: 8px;
}
.comment-images img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
  margin: 0;
}
.comment-images.single img { aspect-ratio: auto; object-fit: contain; max-height: 220px; width: auto; max-width: 100%; }
.comment-images img:nth-child(n+4) { display: none; }
/* 详情页（expand_images）：全部图片展开显示，不再折叠 +N */
.comment-images.expanded img:nth-child(n+4) { display: block; }
.comment-img-cell { position: relative; }
.comment-img-more {
  position: absolute;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px 0 6px 0;
}

/* 首页卡片图片网格：评论网格的放大版（单图保持正文原样展示） */
.card-images { max-width: 480px; margin-top: 10px; }
.card-images .comment-img-more { font-size: 15px; padding: 5px 12px; }

/* 单层回复：平铺缩进在一级评论下 */
.comment-reply {
  margin: 10px 0 0 44px;
  padding: 8px 12px;
  background: #F8F5F1;
  border-left: 3px solid var(--border);
  border-radius: 8px;
}
.comment-reply .comment-head { margin-bottom: 2px; }
.comment-reply .comment-content { font-size: 13px; }
.comment-reply .comment-actions { margin-top: 6px; gap: 12px; }

.reply-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}
.reply-toggle:hover { color: var(--primary); }

.reply-form { margin-top: 10px; }

.comment-login-hint { margin: 12px 0 24px; }

.form-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-note {
  background: #FDF3E3;
  border: 1px solid #EED9B0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px;
  font-size: 15px;
}

.back-link { margin-top: 20px; font-size: 14px; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 22px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.post-card > .badge {
  display: flex;
  width: fit-content;
  margin: -6px 0 10px;
}
.badge-pending { background: #F7E8CD; color: #9A6A12; }
.badge-warn { background: #F7E8CD; color: #9A6A12; }
.badge-approved { background: #E3EFE6; color: var(--success); }
.badge-rejected { background: #F6DEDE; color: var(--danger); }
.badge-featured { background: var(--accent); color: #fff; }
.badge-sensitive { background: var(--danger); color: #fff; }

.captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.captcha-row input[type="text"] { flex: 1; }

.captcha-img {
  height: 44px;
  width: 120px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- 表单 ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 24px;
  margin-bottom: 20px;
}

.form-title { font-size: 19px; margin-bottom: 4px; font-family: "Songti SC", "STSong", serif; letter-spacing: 1px; }
.form-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.success-uid { font-size: 34px; font-weight: 700; text-align: center; color: var(--primary); margin: 6px 0 14px; letter-spacing: 2px; }
.field-hint, .password-hint { font-size: 12px; margin-top: 4px; }
.field-hint.hint-ok, .password-hint.hint-ok { color: #2E7D32; }
.field-hint.hint-err, .password-hint.hint-err { color: var(--danger); }

.form-field { margin-bottom: 16px; }

.form-field label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: #4A453F;
}

.form-field .req { color: var(--danger); margin-left: 2px; }

.form-field input[type="text"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="tel"],
.form-field input[type="url"],
.form-field input[type="email"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px; /* ≥16px 防止 iOS 聚焦输入框时自动放大页面（保留手动缩放） */
  background: #FDFCFA;
  font-family: inherit;
  color: var(--text);
}

.form-field textarea { resize: vertical; }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 58, 58, .12);
}

/* 只读态：邮箱等绑定后就不可直接修改，弱化以提示需先解除绑定 */
.form-field input[readonly] {
  background: #F1EEE7;
  color: var(--text-muted);
  cursor: default;
}

.form-field .help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-field .error { font-size: 13px; color: var(--danger); margin-top: 4px; }

.form-agree {
  background: #FAF6F0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 6px 0 12px; /* 位于注册按钮上方时的间距 */
}

.form-agree input[type="checkbox"] { margin-top: 4px; flex-shrink: 0; }
.form-agree .agree-title { font-size: 14px; font-weight: 600; color: var(--primary); display: block; }
.form-agree .agree-text { font-size: 12px; color: #57504A; display: block; margin-top: 2px; }

.form-foot { margin-top: 14px; text-align: center; font-size: 14px; color: var(--text-muted); }

.form-switch { background: #FAF6F0; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.form-switch .switch-label { display: flex; gap: 8px; align-items: center; font-size: 15px; margin: 0; cursor: pointer; }

/* 公开选项开关组：移动端单列，桌面端并排 */
.switch-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.switch-grid .form-field { margin-bottom: 0; }
.mini-value-sm { font-size: 16px; line-height: 1.5; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  text-align: center;
  transition: background .15s;
  font-family: inherit;
}

.btn:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background: #FBF3EE; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #942E2E; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #336644; }
.btn-xs { padding: 4px 10px; font-size: 13px; border-radius: 6px; }

/* 内置图标的按钮（如"上传图片/视频"）：图标与文字垂直居中 */
.btn .btn-icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 5px; }

/* ---------- 上传 / Markdown 提示 ---------- */
.upload-area { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; flex-wrap: wrap; }
.upload-hint { font-size: 12px; color: var(--text-muted); }

/* ---------- 正文下方媒体区（发布/编辑页编辑器 + 只读展示） ---------- */
.post-media { margin: 4px 0 10px; }
.post-images { margin-top: 8px; }
.media-editor { margin: 4px 0 10px; }
.media-editor-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.media-editor-list {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0;
  min-height: 0;
}
.media-editor-item {
  position: relative; width: 96px; height: 96px;
  border: 1px solid rgba(0,0,0,.12); border-radius: 8px; overflow: hidden;
  background: var(--bg-secondary, #f5f5f5);
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
}
.media-editor-item.dragging { opacity: .45; border-color: var(--brand, #b0263a); }
.media-editor-thumb { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.media-editor-thumb.video {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  display: flex; align-items: center; justify-content: center; cursor: default;
}
/* 转码状态：就绪可提交 / 仍在切片 / 失败需重传，颜色区分，不用打开控制台猜 */
.media-editor-thumb.video.is-ready { color: #1a7f37; background: #eaf6ec; }
.media-editor-thumb.video.is-processing { color: #8a6d1f; background: #fdf6e3; }
.media-editor-thumb.video.is-failed { color: #a33; background: #fdf3f3; }
/* 视频封面：img 缩略图（就绪用服务端 poster，转码中用本地抽的第一帧） */
.media-editor-thumb.video-cover { object-fit: cover; background: #000; }
/* 名称叠在封面底部：半透明黑条 + 单行截断，长文件名不撑破方块 */
.media-editor-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 6px; font-size: 11px; line-height: 1.3;
  color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .72) 38%);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
/* 转码角标：压在封面右上角，不和名称抢视线 */
.media-editor-badge {
  position: absolute; top: 4px; right: 4px;
  padding: 1px 6px; border-radius: 9px;
  font-size: 10px; line-height: 1.6; color: #fff;
  background: rgba(0, 0, 0, .6); pointer-events: none;
}
.media-editor-badge.is-processing { background: rgba(160, 110, 20, .88); }
.media-editor-badge.is-failed { background: rgba(170, 40, 40, .9); }
.media-editor-grip {
  position: absolute; top: 4px; left: 4px;
  font-size: 11px; line-height: 1; letter-spacing: -2px;
  color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.7);
  pointer-events: none; opacity: .85;
}
.media-editor-remove {
  position: absolute; top: 0; right: 0;
  width: 22px; height: 22px; line-height: 20px; text-align: center;
  border: none; border-radius: 0 0 0 8px;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 16px; padding: 0;
}
.media-editor-remove:hover { background: rgba(180,30,40,.85); }
.media-editor-note { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; min-height: 15px; }
/* 上传进度条：跟随具体文件的上传进度（XHR upload.onprogress），完成后隐藏 */
.media-progress { margin-top: 6px; }
.media-progress-track {
  height: 6px; border-radius: 3px; overflow: hidden;
  background: rgba(0,0,0,.08);
}
.media-progress-fill {
  height: 100%; width: 0; border-radius: 3px;
  background: var(--brand, #b0263a);
  transition: width .15s linear;
}
/* 文案占满整行、取消按钮贴最右侧（长文案也不把 × 挤走） */
.media-progress-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.media-progress-text { flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted); }
.media-progress-cancel {
  flex: none; width: 20px; height: 20px; line-height: 1; padding: 0;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.06); color: var(--text-muted);
  font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.media-progress-cancel:hover { background: rgba(0,0,0,.12); color: var(--text); }
.media-editor .btn:disabled { opacity: .5; cursor: not-allowed; }
.md-hint {
  font-size: 12px;
  color: var(--text-muted);
  background: #FAF6F0;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
}
.md-hint code { background: #F1EDE4; padding: 1px 5px; border-radius: 4px; }

/* 发布页：保存草稿 + 提交按钮并排 */
.form-actions { display: flex; gap: 10px; align-items: center; }
.form-actions .btn-block { flex: 1; }

/* 草稿箱 */
.badge-draft { background: #EFECE6; color: var(--text-muted); }
.draft-preview { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.draft-tags { color: var(--text-muted); font-size: 12px; margin-left: 10px; }
.draft-card .post-title { font-size: 16px; }

/* 草稿弹窗三按钮：空间不足时换行 */
.modal-actions-3 { flex-wrap: wrap; justify-content: flex-end; }

.confirm-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  background: #FDFCFA;
  font-family: inherit;
  color: var(--text);
}

.confirm-select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 58, 58, .12);
}

/* ---------- 数据看板 ---------- */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px 8px;
  margin-bottom: 20px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
  min-width: 0;
}

.chart-bar {
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height .3s;
}

.chart-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  transform: rotate(-30deg);
  transform-origin: top left;
}

/* ---------- 统计卡片 / 小卡片 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, transform .15s;
}

.stat-card:hover { box-shadow: 0 4px 14px rgba(45, 42, 38, .1); transform: translateY(-2px); }

.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); font-family: "Songti SC", "STSong", serif; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.mini-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.mini-label { font-size: 13px; color: var(--text-muted); }
.mini-value { font-size: 22px; font-weight: 700; color: var(--primary); margin-top: 4px; font-family: "Songti SC", "STSong", serif; }
.text-warning { color: var(--warning); }

/* ---------- 后台 ---------- */
.manage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 18px;
}

.manage-nav a {
  padding: 7px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.manage-nav a:hover { border-color: var(--primary); color: var(--primary); }
.manage-nav a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.manage-nav a .nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: #e6413e; color: #fff; font-size: 12px; line-height: 1;
}
.manage-nav a.active .nav-badge { background: rgba(255,255,255,.25); }

.stat-cell { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

.status-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.status-tabs a {
  padding: 7px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.status-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

th { background: #FAF7F1; color: #6B645A; font-weight: 600; font-size: 13px; }

.table-wrap tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FDFBF7; }

.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { display: inline-flex; }
.inline-form { display: inline-flex; }
.inline-form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form-row .form-field { margin-bottom: 0; }

.search-bar { display: flex; gap: 8px; margin-bottom: 14px; }

.home-search {
  max-width: 520px;
  margin: 0 auto 22px;
}
.home-search input { flex: 1; max-width: none; }

.search-summary { margin-bottom: 14px; }
.manage-search { max-width: 460px; margin-bottom: 0; }
.search-bar input {
  flex: 1;
  max-width: 320px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px; /* ≥16px 防止 iOS 聚焦自动放大 */
  background: #fff;
}

select { font-family: inherit; }

.reject-inline input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  min-width: 220px;
}

/* ---------- 审核 ---------- */
.review-card .review-content { margin: 10px 0; }
.review-card summary { cursor: pointer; color: var(--primary); font-size: 14px; }
.review-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.reject-box:not([hidden]) { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 260px; }
.reject-box input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px; /* ≥16px 防止 iOS 聚焦自动放大 */
}

/* 举报：入口按钮 + 就地展开表单 */
.report-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
  font-size: 13px;
}
.report-toggle:hover { color: var(--danger); }
.report-toggle:disabled { color: var(--text-muted); opacity: .6; cursor: default; }
.report-box:not([hidden]) { margin-top: 10px; }
.report-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-row select, .report-row input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.report-row select { max-width: 180px; }
.report-row input { flex: 1; min-width: 200px; }
.report-info { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; }
.report-tabs { display: flex; gap: 16px; margin: 12px 0 16px; font-size: 14px; }
.report-tabs a { color: var(--text-muted); text-decoration: none; padding-bottom: 3px; border-bottom: 2px solid transparent; }
.report-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.badge-handled { background: #E3EFE6; color: var(--success); }
.badge-dismissed { background: #EFECE6; color: var(--text-muted); }

/* ---------- 提示与通知 ---------- */
.notice {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
}

.notice-warning { background: #FDF3E3; border: 1px solid #EED9B0; color: #8A5A12; }
.notice-success { background: #E7F2EA; border: 1px solid #BFD9C7; color: #2E5A3A; }

.code-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.code-list code {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 13px;
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(340px, calc(100vw - 32px));
}

.toast {
  padding: 10px 18px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  animation: toast-in .25s ease;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: #5A6B8C; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- 确认弹窗（自定义，替代原生 confirm） ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(45, 42, 38, .48);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: 14px;
  max-width: 380px;
  width: 100%;
  padding: 24px 24px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  animation: modal-in .2s ease;
}

.modal-title {
  font-size: 17px;
  margin-bottom: 10px;
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: 1px;
}

.modal-message {
  font-size: 14px;
  color: #57504A;
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap; /* 弹窗按钮放不下时整行右对齐换行，避免中文标签被断行 */
}

.modal-actions .btn {
  white-space: nowrap; /* 标签不折行 */
  padding: 10px 14px;  /* 弹窗内按钮收紧左右内边距，三个按钮同行可放下 */
}

/* ---------- 分享面板（详情页） ---------- */
.share-open {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}
.share-open:hover { color: var(--primary); }
.share-modal { max-width: 360px; }
.share-channels {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 16px;
}
.share-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #3A322C;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.share-channel:hover { border-color: var(--primary); color: var(--primary); }
.share-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.share-qq { background: #12B7F5; }
.share-wechat { background: #07C160; }
.share-link { background: #8A6F63; font-size: 16px; }
.share-qr { text-align: center; margin-bottom: 16px; }
.share-qr img {
  width: 180px;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  background: #fff;
}
.share-qr .muted { margin-top: 8px; font-size: 13px; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}

.totp-setup {
  display: flex;
  gap: 24px;
  align-items: center;
  margin: 16px 0 20px;
  flex-wrap: wrap;
}

.totp-qr {
  width: 180px;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.totp-secret { min-width: 0; }

.totp-secret code {
  display: inline-block;
  background: #F1EDE4;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 15px;
  letter-spacing: 1px;
  margin-top: 6px;
  word-break: break-all; /* 长密钥文本换行，防止移动端溢出 */
  white-space: normal;
  max-width: 100%;
}

/* ---------- 错误页 ---------- */
.error-page { text-align: center; padding: 80px 20px 100px; }
.error-code {
  font-size: 72px;
  font-weight: 700;
  color: var(--primary);
  font-family: "Songti SC", "STSong", serif;
  opacity: .85;
  line-height: 1.2;
}
.error-page h1 { font-size: 22px; margin: 10px 0 8px; font-family: "Songti SC", "STSong", serif; }
.error-page p { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }

.totp-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.totp-tab {
  flex: 1;
  padding: 9px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.totp-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- 通知 ---------- */
.notif-actions { margin-top: 8px; }

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.notification-item:last-child { border-bottom: none; }
.notification-item .notif-time { margin-left: auto; color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.notification-item.unread { background: #FBF4EE; }
.notification-item.unread::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 7px;
}

.nav-notif {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
}

.notif-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.notif-text { display: none; }

.notif-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

.notif-dot {
  position: absolute;
  top: -6px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--primary-dark);
}

/* ---------- 分页 ---------- */
/* ---------- 首页排序切换 ---------- */
.feed-sort {
  display: flex;
  gap: 6px;
  margin: 16px 0 12px;
}

.feed-sort-btn {
  padding: 4px 16px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--card);
  transition: all .2s;
}

.feed-sort-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.feed-sort-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ---------- 分页（Element Plus pagination 风格） ---------- */
.el-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 10px;
  color: #303133;
  font-size: 14px;
}

.el-pagination__total { color: #606266; white-space: nowrap; }

.el-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  color: #303133;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}
.el-pagination__btn:hover { color: var(--primary); border-color: var(--primary); }
.el-pagination__btn.is-disabled { color: #c0c4cc; background: #f4f4f5; cursor: not-allowed; }
.el-pagination__btn.is-disabled:hover { border-color: #dcdfe6; }

.el-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.el-pager__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 4px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  color: #303133;
  box-sizing: border-box;
}
.el-pager__item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 100%;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.el-pager__item a:hover { color: var(--primary); }
.el-pager__item.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
}
.el-pager__item.more { min-width: 24px; border-color: transparent; color: #606266; cursor: default; }

.el-pagination__jump { color: #606266; white-space: nowrap; }
.el-pagination__jump .el-pagination__editor {
  width: 48px;
  height: 28px;
  margin: 0 4px;
  padding: 0 4px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
  color: #303133;
  font: inherit;
  font-size: 14px;
  text-align: center;
  box-sizing: border-box;
}
.el-pagination__jump .el-pagination__editor:focus { border-color: var(--primary); outline: none; }

@media (max-width: 640px) {
  .el-pagination__total, .el-pagination__jump { display: none; }
}

/* ---------- 页脚 ---------- */
.site-footer { margin-top: auto; }

.footer-inner {
  background: #2D2A26;
  color: #A9A296;
  font-size: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
}

.copyright { letter-spacing: 1px; white-space: nowrap; }

.disclaimer-inline {
  font-size: 11px;
  color: #8A847C;
  text-align: right;
  line-height: 1.6;
  flex: 1;
  min-width: 260px;
}

/* ---------- 后台：登录 ID 行内输入 ---------- */
.uid-input {
  width: 84px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 登录 ID 点击编辑：铅笔图标 + 行内输入框 */
.uid-pencil {
  margin-left: 6px;
  color: #B8B0A4;
  cursor: pointer;
  font-size: 13px;
}
.uid-pencil:hover { color: var(--primary); }
.uid-edit-form { display: inline-flex; gap: 6px; align-items: center; }

/* 后台称号管理：操作列行内输入框（紧凑风格，focus 高亮与全站一致） */
.title-input {
  width: 108px;
  padding: 4px 8px;
  margin-right: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #FDFCFA;
  color: var(--text);
  font-family: inherit;
}
.title-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 58, 58, .12);
}

/* ---------- 响应式：移动端优先适配 ---------- */
@media (max-width: 640px) {
  .nav-toggle { display: block; }

  /* 移动端通知：图标换为文字 */
  .notif-icon { display: none; }
  .notif-text {
    display: inline;
    font-size: 14px;
    color: rgba(255, 255, 255, .92);
    line-height: 1;
  }
  .nav-notif { padding: 12px 20px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .2);
  }

  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 20px; border-radius: 0; }

  .nav-user-wrap { width: 100%; }

  .nav-user-btn {
    width: 100%;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 0;
  }

  .nav-dropdown {
    position: static;
    margin: 4px 16px 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    box-shadow: none;
  }

  .nav-dropdown a { color: rgba(255, 255, 255, .92); }
  .nav-dropdown a:hover { background: rgba(255, 255, 255, .12); color: #fff; }

  .hero { padding: 40px 16px 34px; }
  .hero h1 { font-size: 28px; letter-spacing: 6px; }

  .post-card { padding: 16px 16px; }

  .toast-wrap { top: 60px; right: 12px; left: 12px; }

  .inline-form-row .form-field { flex: 1; min-width: 120px; }
}

@media (min-width: 641px) {
  .container { padding: 32px 20px 48px; }
  .switch-grid { grid-template-columns: 1fr 1fr; }
}

/* 首页发布按钮：右下角浮动圆形加号（FAB），固定不随页面滚动 */
.home-publish-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(178, 58, 58, .4);
}
.home-publish-btn svg { width: 26px; height: 26px; }

/* ---------- 投稿正文 @提及下拉 ---------- */
.mention-wrap { position: relative; }
.mention-mirror {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  pointer-events: none;
  z-index: -1;
}
.mention-dropdown {
  position: absolute;
  z-index: 60;
  min-width: 240px;
  max-width: 340px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  padding: 4px 0;
  font-size: 14px;
}
.mention-item {
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mention-item .mention-uid { color: var(--text-muted); font-size: 12px; margin-left: 8px; }
.mention-item.active, .mention-item:hover { background: rgba(139, 58, 58, .08); }
.mention-empty { padding: 7px 12px; color: var(--text-muted); }

/* ---------- 图片查看器（Lightbox） ---------- */
.post-content img { cursor: pointer; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, .92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.lb-stage.lb-grabbing { cursor: grabbing; }
.lb-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
/* 滑动切换时的相邻图：默认隐藏，位于当前图下层，跟手滑动时露出 */
.lb-stage .lb-neighbor { opacity: 0; }
.lb-close {
  position: fixed;
  top: 14px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 2001;
}
.lb-close:hover { background: rgba(255, 255, 255, .28); }
.lb-controls {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2001;
  background: rgba(0, 0, 0, .55);
  padding: 6px 10px;
  border-radius: 22px;
}
.lb-controls button {
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 17px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lb-controls button:hover { background: rgba(255, 255, 255, .32); }
/* 缩放比例 toast：悬浮在底部控制条上方，显示当前百分比 */
.lb-zoom-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  padding: 7px 14px;
  border-radius: 15px;
  z-index: 2001;
  pointer-events: none;
  white-space: nowrap;
}
.lb-zoom-toast[hidden] { display: none; }
.lb-hint {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  z-index: 2001;
  pointer-events: none;
}
.lb-count {
  position: fixed;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
  z-index: 2001;
  pointer-events: none;
  background: rgba(0, 0, 0, .4);
  padding: 2px 12px;
  border-radius: 12px;
}

/* ---------- 关注按钮（用户主页 / 关注列表 / 搜索结果） ---------- */
.follow-btn {
  display: inline-block;
  padding: 6px 18px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.follow-btn:hover { background: #7A3131; border-color: #7A3131; }
.follow-btn.following {
  background: #F0EAE5;
  color: #8A6F63;
  border-color: #E0D6CE;
}
.follow-btn.following:hover { background: #EAE0D8; border-color: #E0D6CE; }
.follow-pop { animation: follow-pop .3s ease; }
@keyframes follow-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ---------- 用户主页 ---------- */
.user-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 6px;
  margin-bottom: 8px;
}
.user-profile-name { margin: 0 0 2px; }
.user-profile-uid { margin: 0 0 6px; font-size: 13px; }
.user-profile-meta { margin: 0 0 8px; color: #777; font-size: 13px; }
.user-profile-stats { margin: 0; font-size: 15px; }
.user-profile-stats a { color: var(--primary); text-decoration: none; font-weight: 600; }
.user-profile-stats a:hover { text-decoration: underline; }
.user-profile-stats .stat-sep { color: #BBB; margin: 0 6px; }
.user-profile-actions { padding-top: 6px; }
.user-posts-title { font-size: 17px; margin: 18px 0 10px; }

/* ---------- 用户卡片（搜索用户 / 关注列表） ---------- */
.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--border, #E8E0DA);
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fff;
}
.user-card-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.user-card-avatar { display: inline-flex; align-items: center; }
.user-card-avatar img { transition: transform .15s ease; }
.user-card-avatar:hover img { transform: scale(1.06); }
.user-card-name { font-size: 16px; font-weight: 600; color: var(--primary); text-decoration: none; }
.user-card-name:hover { text-decoration: underline; }
.user-card-uid { font-size: 12px; color: #999; }
.user-card-stats { font-size: 13px; color: #777; }

/* ---------- 搜索分类 tab ---------- */
.search-tabs {
  display: flex;
  gap: 6px;
  margin: 4px 0 14px;
  border-bottom: 1px solid #EEE;
}
.search-tab {
  padding: 8px 18px;
  font-size: 15px;
  color: #777;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.search-tab:hover { color: var(--primary); }
.search-tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* ---------- 头像（IconPark 人物图标为默认，白底小圆角方形） ---------- */
.avatar {
  border-radius: 6px;
  object-fit: cover;
  flex: none;
  vertical-align: middle;
}
.avatar-default { background: #fff; border: 1px solid var(--border); }
.avatar-sm { width: 22px; height: 22px; }
.avatar-md { width: 32px; height: 32px; }
.avatar-lg { width: 96px; height: 96px; }

/* 作者/评论链接内嵌头像：flex 对齐 */
.post-author, .comment-author { display: inline-flex; align-items: center; gap: 5px; }

/* 用户名按角色着色：管理员橙 #f39c11、审核员蓝 #3498db、普通用户保持主色；
   a .user-name 双类选择器保证链接内嵌的 span 也生效（覆盖 .comment-author/.user-card-name 等） */
.user-name.user-admin { color: #f39c11; }
.user-name.user-editor { color: #3498db; }
a .user-name.user-admin { color: #f39c11; }
a .user-name.user-editor { color: #3498db; }

/* 称号徽章：圆角矩形、白字，背景色跟随用户名角色色（默认主色 = 普通用户） */
.user-badge {
  display: inline-block;
  color: #fff;
  background: var(--primary);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.user-badge.user-admin { background: #f39c11; }
.user-badge.user-editor { background: #3498db; }


/* 用户主页：头像 + 信息靠左，操作按钮靠右 */
.user-profile-head { justify-content: flex-start; align-items: center; }
.user-profile-head .avatar-lg { flex: none; }
.user-profile-actions { margin-left: auto; }

/* 用户卡片：头像 + 文本列竖排 */
.user-card-main { align-items: center; }
.user-card-text { display: flex; flex-direction: column; gap: 1px; }

/* 资料编辑：头像预览（点击上传）+ 隐藏原生文件输入 */
.avatar-field { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.avatar-input { display: none; }
.avatar-upload { position: relative; display: inline-block; cursor: pointer; line-height: 0; }
.avatar-upload .avatar-lg { transition: filter .2s; }
.avatar-upload::after {
  content: "更换头像";
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px;
  text-align: center; padding: 4px 0; border-radius: 0 0 6px 6px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.avatar-upload:hover::after { opacity: 1; }
.avatar-upload:hover .avatar-lg { filter: brightness(.9); }

/* ---------- 头像裁剪编辑器 ---------- */
.modal-crop { max-width: 400px; text-align: center; }
.crop-stage {
  position: relative;
  margin: 4px auto 16px;
  width: 340px;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
}
.crop-stage canvas { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  justify-content: center;
}
.crop-zoom-label { font-size: 13px; color: var(--text-muted); flex: none; }
.crop-controls input[type="range"] { width: 220px; max-width: 100%; accent-color: var(--primary); }

/* 用户主页：简介 */
.user-profile-bio {
  margin: 0 0 10px;
  color: #57504A;
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- 回到顶部（首页悬浮图标按钮，无文字；与发布按钮同尺寸同配色，固定在发布按钮正上方） ---------- */
.to-top-btn {
  position: fixed;
  right: 24px; /* 与发布按钮相同 right + 相同宽度 → 水平完全对齐 */
  bottom: 92px; /* 发布按钮顶部（24 + 54）+ 14px 间距 */
  z-index: 90;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(178, 58, 58, .4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .25s, transform .25s, visibility .25s, background .15s;
}
.to-top-btn svg { width: 26px; height: 26px; }
.to-top-btn.show { opacity: 1; visibility: visible; transform: none; }
.to-top-btn:hover { background: #942E2E; }

/* ---------- 正文视频（HLS 切片 + 自研播放器） ---------- */
.post-content video, .post-content .video-shell,
.post-media video, .post-media .video-shell { max-width: 100%; }
.video-shell {
  position: relative;
  margin: 12px 0;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.video-shell video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; user-select: none; }

/* 全屏：必须显式清掉 margin / max-width / aspect-ratio，否则 UA 的 :fullscreen 只给到
   width/height 100%，而 .video-shell 自身的 margin:12px 会把画面从屏幕边缘推开一圈、
   aspect-ratio:16/9 与 100% 高度冲突时也容易出偏。两条选择器必须分开写：Safari 的
   :-webkit-full-screen 在别的浏览器里是无效选择器，混在一个选择器列表里会让整条规则失效。 */
.video-shell:fullscreen { margin: 0; max-width: none; aspect-ratio: auto; border-radius: 0; }
.video-shell:-webkit-full-screen { margin: 0; max-width: none; aspect-ratio: auto; border-radius: 0; }

/* 首页/列表视频封面卡：仅封面图 + 大播放按钮，点击进入详情自动播放 */
.video-cover {
  position: relative; display: block;
  margin: 12px 0; max-width: 100%;
  aspect-ratio: 16 / 9; background: #000;
  border-radius: 8px; overflow: hidden; cursor: pointer;
}
.video-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.video-cover-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.video-cover-play svg { width: 110px; height: 110px; filter: drop-shadow(0 2px 10px rgba(0,0,0,.5)); }
.video-cover:hover .video-cover-play svg { transform: scale(1.06); transition: transform .15s; }

/* 中央加载遮罩（仅 buffering 时显示，不含播放按钮——播放入口统一在底部控制条） */
.vp-center {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
  background: rgba(0, 0, 0, .15);
}
.vp-center.loading { display: flex; }
.vp-spinner {
  display: none; width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: vp-spin .8s linear infinite;
}
.vp-center.loading .vp-spinner { display: block; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

/* 控制条 */
.vp-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff; opacity: 0; transition: opacity .2s;
}
.video-shell:hover .vp-controls { opacity: 1; }
.vp-controls button {
  background: none; border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
}
.vp-controls button svg { width: 22px; height: 22px; }
.vp-time { font-size: 12px; color: #eee; white-space: nowrap; min-width: 78px; text-align: center; }
.vp-seek {
  position: relative; flex: 1; height: 5px; cursor: pointer;
  background: rgba(255,255,255,.25); border-radius: 3px;
}
.vp-buffered, .vp-progress {
  position: absolute; left: 0; top: 0; bottom: 0; height: 100%; border-radius: 3px;
}
.vp-buffered { background: rgba(255,255,255,.35); }
.vp-progress { background: var(--brand, #b0263a); }
.vp-volume { width: 64px; accent-color: var(--brand, #b0263a); }

/* 错误遮罩 */
.vp-error {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(0,0,0,.7); font-size: 14px; padding: 0 16px; text-align: center;
}

/* 正文内视频占位（转码中 / 失败） */
.video-processing, .video-failed {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 72px; margin: 12px 0; border-radius: 8px;
  background: #f5f5f5; color: #666; font-size: 14px;
}
.video-processing.flash { color: #888; }
.video-failed { color: #a33; background: #fdf3f3; }
.video-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,.15); border-top-color: #666; border-radius: 50%;
  animation: vp-spin .8s linear infinite;
}

/* 身份认证：状态条 + 已提交证明缩略图（图片走鉴权视图，不是 /media/） */
.identity-status {
  margin: 14px 0 4px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}
.identity-status.is-none { background: #F3F0EC; color: #6B6259; }
.identity-status.is-pending { background: #F7E8CD; color: #9A6A12; }
.identity-status.is-approved { background: #E3EFE6; color: var(--success); }
.identity-status.is-rejected { background: #F7E1E1; color: var(--danger); }

.identity-proofs { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.identity-thumb {
  display: block;
  width: 108px; height: 108px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #F3F0EC;
}
.identity-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
