/* Cat Meme Wiki —— 白色 / 灰色 Wikidot 风格 */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f4f4f4;               /* 页面浅灰底 */
  color: #333;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

a { color: #1a5276; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部：标题正上方居中 ---------- */
.site-header {
  background: #ffffff;
  border-bottom: 3px solid #c9c9c9;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 20px 12px;
  text-align: center;                /* 主标题正上方居中 */
}
.site-logo {
  display: block;
  width: 96px;
  height: auto;
  margin: 0 auto 8px;
  filter: drop-shadow(0 2px 6px rgba(230, 180, 40, .25));
}
.site-title { margin: 0; font-size: 40px; letter-spacing: 1px; }
.site-title a { color: #222; }
.site-title a:hover { text-decoration: none; color: #444; }
.site-sub { margin: 4px 0 10px; color: #888; font-size: 14px; letter-spacing: 2px; }

.user-nav {
  font-size: 13.5px;
  color: #999;
  padding: 6px 0 2px;
  border-top: 1px solid #eee;
  display: inline-block;
  min-width: 60%;
}
.user-nav a { color: #555; }
.user-nav .sep { margin: 0 6px; color: #ccc; }
.user-hello { margin-right: 8px; }

.badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: 1px;
}
.badge-gray  { background: #eee; color: #777; border: 1px solid #ddd; }
.badge-green { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.badge-red   { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }

/* ---------- 提示条 ---------- */
.flash-area { max-width: 1100px; margin: 12px auto -4px; padding: 0 20px; }
.flash {
  padding: 9px 14px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 14px;
  border: 1px solid;
}
.flash-ok   { background: #f1f8f1; border-color: #cde3cd; color: #2e6b2e; }
.flash-warn { background: #fdf6ec; border-color: #f0dcc0; color: #9a6b1f; }

/* ---------- 布局：侧栏 + 内容 ---------- */
.layout {
  max-width: 1100px;
  margin: 18px auto;
  padding: 0 20px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.sidebar { width: 230px; flex-shrink: 0; }
.side-box {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  margin-bottom: 14px;
  padding: 12px 14px;
}
.side-box h3 {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #e6e6e6;
  padding-bottom: 6px;
}
.side-box ul { margin: 0; padding: 0; list-style: none; }
.side-box li { margin: 5px 0; font-size: 14px; }
.side-box a { color: #444; }
.side-box a:hover { color: #1a5276; }

.content { flex: 1; min-width: 0; }

/* ---------- 内容卡片 ---------- */
.wiki-page {
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 5px;
  padding: 26px 34px 34px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.wiki-page.narrow { max-width: 560px; margin: 0 auto; }

.page-title {
  font-size: 28px;
  margin: 6px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e5e5;
  color: #222;
}

.page-actions { margin-bottom: 4px; font-size: 13.5px; }
.page-actions .meta { color: #999; margin-left: 10px; }

/* ---------- 维基正文排版 ---------- */
.wiki-body h2 {
  font-size: 22px; color: #222;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 5px; margin: 26px 0 12px;
}
.wiki-body h3 { font-size: 18px; color: #333; margin: 20px 0 8px; }
.wiki-body h4 { font-size: 16px; color: #444; margin: 16px 0 6px; }
.wiki-body p { margin: 10px 0; }
.wiki-body ul, .wiki-body ol { margin: 10px 0; padding-left: 26px; }
.wiki-body li { margin: 4px 0; }
.wiki-body blockquote {
  margin: 12px 0;
  padding: 8px 16px;
  border-left: 4px solid #c9c9c9;
  background: #f7f7f7;
  color: #555;
  border-radius: 0 4px 4px 0;
}
.wiki-body hr { border: none; border-top: 1px solid #e0e0e0; margin: 20px 0; }
.wiki-body code {
  background: #f2f2f2;
  border: 1px solid #e3e3e3;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: Consolas, "Courier New", monospace;
}
.wikicode {
  background: #f6f6f6;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
}
a.wikilink { color: #1a5276; }
a.wikilink.missing { color: #b03a2e; }
a.missing:hover { text-decoration: underline wavy #b03a2e; }

/* ---------- 表格 ---------- */
.page-table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
.page-table th, .page-table td {
  border: 1px solid #e2e2e2;
  padding: 7px 10px;
  text-align: left;
  vertical-align: middle;
}
.page-table th { background: #f5f5f5; color: #666; font-weight: 600; }
.page-table tr:nth-child(even) td { background: #fafafa; }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-block;
  padding: 5px 14px;
  font-size: 13.5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #444;
  cursor: pointer;
}
.btn:hover { background: #f2f2f2; text-decoration: none; }
.btn-primary { background: #f2f2f2; border-color: #999; color: #222; font-weight: 600; }
.btn-primary:hover { background: #e8e8e8; }
.btn-light { border-color: #e0e0e0; color: #777; }
.btn-danger { color: #b03a2e; border-color: #d9a7a0; }
.btn-danger:hover { background: #fdf1ef; }
.btn-sm { padding: 2px 9px; font-size: 12.5px; }

.edit-form label { display: block; margin: 14px 0 4px; font-size: 13.5px; color: #666; font-weight: 600; }
.edit-form input[type=text], .edit-form input[type=password],
.edit-form textarea, .search-form input[type=text] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
.edit-form textarea { font-family: Consolas, "Microsoft YaHei", monospace; line-height: 1.6; }
.edit-form input:focus, .edit-form textarea:focus, .search-form input:focus {
  outline: none; border-color: #999; box-shadow: 0 0 3px rgba(0,0,0,.1);
}
.form-actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; }

.search-form { display: flex; gap: 10px; margin: 6px 0 16px; }

.notice {
  margin-top: 18px;
  padding: 10px 14px;
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #b3b3b3;
  border-radius: 0 4px 4px 0;
  color: #666;
  font-size: 13.5px;
}

/* ---------- 编辑页预览与语法速查 ---------- */
.preview-box {
  border: 1px dashed #bbb;
  background: #fcfcfc;
  border-radius: 4px;
  padding: 6px 18px 18px;
  margin-bottom: 18px;
}
.preview-label { color: #888; font-size: 14px; font-weight: 600; }
.syntax-cheatsheet {
  margin-top: 26px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 12px 16px;
}
.syntax-cheatsheet h3 { margin: 2px 0 8px; font-size: 14px; color: #777; }
.syntax-cheatsheet table { border-collapse: collapse; width: 100%; font-size: 13px; }
.syntax-cheatsheet td { border: 1px solid #e8e8e8; padding: 4px 8px; }

/* ---------- 管理后台 ---------- */
.admin-section { margin-bottom: 34px; overflow-x: auto; }
.admin-section h2 {
  font-size: 20px; color: #222;
  border-bottom: 2px solid #e5e5e5;
  padding-bottom: 6px;
}
.admin-section .actions form { display: inline-block; margin-right: 6px; }
.admin-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.admin-form input[type=text] {
  padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 13.5px;
}
.admin-form input[name=name] { width: 180px; }
.admin-form input[name=description] { width: 260px; }
.check-label { font-size: 13.5px; color: #555; }
.admin-section select { padding: 4px 6px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; }
.inline { display: inline; }

/* ---------- 其他 ---------- */
.mono { font-family: Consolas, monospace; font-size: .92em; color: #666; }
.dim { color: #999; font-size: .92em; }

/* ---------- 用户头像与个人主页 ---------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
  border: 1px solid #d5d5d5;
  background: #fff;
}
.avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #b8b8b8, #8f8f8f);
  border: none;
}
.av-nav    { width: 26px; height: 26px; font-size: 14px; }
.av-inline { width: 20px; height: 20px; font-size: 11px; }
.av-xs     { width: 18px; height: 18px; font-size: 10px; }
.av-sm     { width: 34px; height: 34px; font-size: 15px; }
.av-big    { width: 96px; height: 96px; font-size: 44px; }

.user-hello { display: inline-flex; align-items: center; gap: 6px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: -4px;
  color: #1a5276;
}
.user-chip span { vertical-align: middle; }
.user-chip.missing-user { color: #b03a2e; }

.profile-stats { display: flex; gap: 16px; font-size: 13.5px; margin: 6px 0 8px; color: #666; }
.profile-stats strong { color: #222; }
.profile-stats a { color: #1a5276; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 5px;
  margin: 6px 0 10px;
}
.profile-name { font-size: 26px; margin: 0 0 4px; }
.profile-info p { margin: 4px 0 10px; }
.profile-sec {
  font-size: 19px;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 5px;
  margin: 22px 0 10px;
  color: #333;
}

/* ---------- 扩展维基语法 ---------- */
.wiki-table {
  border-collapse: collapse;
  margin: 12px 0;
  width: 100%;
  background: #fff;
  font-size: 14px;
}
.wiki-table th,
.wiki-table td {
  border: 1px solid #ccc;
  padding: 7px 12px;
  text-align: left;
  vertical-align: top;
}
.wiki-table th { background: #f0f0f0; font-weight: 600; }
.wiki-table tr:nth-child(even) td { background: #fafafa; }

.wiki-toc {
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 18px;
  margin: 10px 0 18px;
  font-size: 13.5px;
}
.wiki-toc .toc-title { font-weight: 600; color: #444; margin-bottom: 6px; }
.wiki-toc .toc-l1 { margin: 3px 0; }
.wiki-toc .toc-l2 { margin: 3px 0 3px 1.4em; }
.wiki-toc .toc-l3 { margin: 3px 0 3px 2.8em; }
.wiki-toc .toc-l4 { margin: 3px 0 3px 4.2em; }
.wiki-toc a { color: #1a5276; }

.wiki-note {
  display: inline-block;
  background: #fdf6e3;
  border: 1px solid #e8d9a0;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 13px;
  color: #7a6a2f;
}

.wiki-footnotes { font-size: 13px; color: #555; margin-top: 24px; }
.wiki-footnotes .toc-title { font-weight: 600; margin: 8px 0 4px; }
.wiki-footnotes ol { margin: 0 0 0 1.4em; padding: 0; }
.wiki-footnotes li { margin: 4px 0; }
.fnref a { color: #1a5276; text-decoration: none; }
.fnref a:hover { text-decoration: underline; }
.fn-back { text-decoration: none; }
.fn-back:hover { text-decoration: underline; }

.align-center { text-align: center; }
.align-left { text-align: left; }
.align-right { text-align: right; }
.align-justify { text-align: justify; }

.wiki-collapsible {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
  margin: 12px 0;
  overflow: hidden;
}
.wiki-collapsible summary {
  cursor: pointer;
  padding: 9px 14px;
  font-weight: 600;
  color: #1a5276;
  background: #f4f4f4;
  user-select: none;
}
.wiki-collapsible summary:hover { background: #eee; }
.wiki-collapsible > *:not(summary) { margin: 12px 14px; }

/* ---------- 可编辑侧栏（nav:side 页面） ---------- */
.side-nav { padding: 12px 14px; }
.side-nav h4 {
  margin: 12px 0 4px;
  font-size: 13px;
  color: #666;
  text-transform: none;
  letter-spacing: 0;
}
.side-nav h4:first-child { margin-top: 0; }
.side-nav ul { margin: 4px 0; padding-left: 1.1em; }
.side-nav li { margin: 3px 0; font-size: 13.5px; }
.side-nav p { margin: 4px 0; font-size: 13px; color: #555; }
.side-nav table { font-size: 12.5px; margin: 6px 0; }
.side-nav .wiki-toc { display: none; }

/* ---------- 私信与公告 ---------- */
.msg-link { position: relative; }
.unread-badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 5px;
  margin-left: 3px;
  background: #d93025;
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
}
.msg-actions { margin: 10px 0 16px; }
.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg-item {
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 10px 14px;
  background: #fff;
}
.msg-item.unread { border-left: 3px solid #d93025; background: #fffdf8; }
.msg-item.notice { background: #fffaf3; border-color: #ecd9b0; }
.msg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.msg-time { margin-left: auto; font-size: 12px; }
.unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d93025; display: inline-block;
}
.msg-preview { margin: 6px 0; font-size: 14px; }
.msg-preview a { color: #333; text-decoration: none; }
.msg-preview a:hover { color: #1a5276; text-decoration: underline; }
.msg-ops { display: flex; gap: 8px; }
.msg-detail { border: 1px solid #e2e2e2; border-radius: 6px; background: #fff; padding: 16px 20px; }
.msg-detail.notice { background: #fffaf3; border-color: #ecd9b0; }
.msg-body { margin: 14px 0; border-top: 1px solid #eee; padding-top: 14px; }
.msg-detail-ops { display: flex; gap: 8px; align-items: center; }
.notice-form textarea { width: 100%; margin-bottom: 8px; }

/* ---------- 群聊 ---------- */
.av-xxs { width: 16px; height: 16px; font-size: 9px; }

.chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  background: #f7f7f7;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.chat-members { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; flex: 1; }
.chat-head-ops { display: flex; gap: 8px; align-items: center; }

.invite-box {
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fafafa;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.invite-box summary { cursor: pointer; color: #1a5276; font-weight: 600; }
.member-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 0;
  max-height: 240px;
  overflow-y: auto;
}
.picker-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; }

.chat-box {
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fbfbfb;
  padding: 14px;
  max-height: 560px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.chat-msg { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; }
.chat-msg.self { flex-direction: row-reverse; }
.chat-bubble {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 76%;
}
.chat-msg.self .chat-bubble { background: #f4f8fb; border-color: #d7e5ef; }
.chat-msg-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-bottom: 4px; }
.chat-msg-head a { font-weight: 600; color: #1a5276; }
.chat-msg.self .chat-msg-head { justify-content: flex-end; }
.chat-body p { margin: 4px 0; }
.chat-body { font-size: 14px; }

.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; }

.mention {
  color: #1a5276;
  background: #eaf3f9;
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 600;
  text-decoration: none;
}
.mention:hover { text-decoration: underline; }
.mention-all {
  color: #a33;
  background: #fdecec;
  border: 1px solid #f0c9c9;
}

/* ---------- 标签 ---------- */
.tag-area { margin: -6px 0 16px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tag-wrap { display: inline-flex; align-items: center; gap: 2px; }
.tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12.5px;
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 12px;
  color: #555;
}
.tag:hover { background: #ececec; color: #1a5276; text-decoration: none; }
.tag-count {
  display: inline-block;
  margin-left: 5px;
  padding: 0 6px;
  background: #e4e4e4;
  border-radius: 8px;
  font-size: 11px;
  color: #777;
}
.tag-x {
  border: none;
  background: none;
  color: #bbb;
  font-size: 14px;
  cursor: pointer;
  padding: 0 3px;
  line-height: 1;
}
.tag-x:hover { color: #b03a2e; }
.tag-add select {
  padding: 3px 6px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 13px;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag-cloud .tag { font-size: 14px; padding: 4px 14px; }

/* ---------- 图片与上传 ---------- */
.wiki-img {
  max-width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin: 4px 0;
}
.upload-result { margin-bottom: 16px; }
.upload-result label { display: block; font-size: 13.5px; color: #2e6b2e; margin-bottom: 4px; }
.upload-result .syntax-copy {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #b5d0b5;
  background: #f1f8f1;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 13.5px;
  color: #2e5b2e;
}

.site-footer {
  max-width: 1100px;
  margin: 10px auto 26px;
  padding: 12px 20px 0;
  border-top: 1px solid #ddd;
  color: #999;
  font-size: 12.5px;
  text-align: center;
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .site-title { font-size: 30px; }
  /* 纵向堆叠时 .content 会按 stretch 撑满，宽表格的 min-width 会顶破页面，这里强制收缩 */
  .content, .wiki-page { width: 100%; max-width: 100%; box-sizing: border-box; }
}

/* ---------- 注册邮箱 / 举报 / 封禁 ---------- */
.edit-form input[type=email] {
  width: 100%; padding: 8px 10px; border: 1px solid #ccc;
  border-radius: 4px; font-size: 14px; font-family: inherit;
}
.edit-form input[type=email]:focus { outline: none; border-color: #999; box-shadow: 0 0 3px rgba(0,0,0,.1); }
.form-hint { margin-top: 8px; font-size: 12.5px; }
.notice ul { margin: 6px 0 0 18px; padding: 0; }
.notice p { margin: 0 0 4px; }
.notice code {
  background: #ececec; padding: 0 4px; border-radius: 3px;
  font-family: Consolas, monospace; font-size: 12.5px;
}

.report-form select {
  width: 100%; padding: 8px 10px; border: 1px solid #ccc;
  border-radius: 4px; font-size: 14px; background: #fff; font-family: inherit;
}
.report-context {
  background: #f7f7f7; border: 1px solid #e2e2e2; border-radius: 4px;
  padding: 6px 12px; font-size: 13.5px; margin-bottom: 4px;
}
.report-context .badge { background: #ececec; color: #666; border: 1px solid #ddd; }

.report-table th { width: 112px; text-align: left; background: #fafafa; }
.report-detail { white-space: pre-wrap; line-height: 1.7; }
.report-card { margin-bottom: 18px; }

.report-actions-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 18px; align-items: start; }
.report-ban-form {
  display: block; background: #fdf6f5; border: 1px solid #f0d3ce;
  border-radius: 4px; padding: 14px 16px; margin-top: 0;
}
.report-ban-form label, .report-resolve label {
  display: block; margin: 10px 0 4px; font-size: 13px; color: #666; font-weight: 600;
}
.report-ban-form input[type=text], .report-ban-form select,
.report-resolve input[type=text] {
  width: 100%; padding: 7px 10px; border: 1px solid #ccc;
  border-radius: 4px; font-size: 13.5px; font-family: inherit;
}
.report-ban-form .btn { margin-top: 12px; }
.report-resolve {
  background: #f8f8f8; border: 1px solid #e5e5e5;
  border-radius: 4px; padding: 14px 16px;
}
.report-resolve .admin-form { display: block; margin-top: 2px; }
.report-resolve .btn { margin-top: 10px; }

tr.report-open td { background: #fffaf4; }
tr.user-banned td { background: #fdf5f4; }
.ban-note { font-size: 11.5px; line-height: 1.45; margin-top: 2px; max-width: 160px; }
.ban-form input[type=text] { width: 96px; }
.ban-form select { padding: 2px 4px; font-size: 12.5px; }

.banned-box { text-align: center; padding: 16px 0 28px; }
.banned-icon { font-size: 52px; line-height: 1; margin-bottom: 6px; }
.banned-lead { color: #555; }
.banned-reason {
  background: #fdf6f5; border: 1px solid #f0d3ce; border-radius: 4px;
  padding: 12px 16px; margin: 16px 0; text-align: left;
}
.banned-reason p { margin: 2px 0; }
.banned-actions { justify-content: center; }

@media (max-width: 760px) {
  .report-actions-grid { grid-template-columns: 1fr; }
}

.user-sub { font-size: 11.5px; line-height: 1.45; margin-top: 2px; }
.ban-form { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ---------- 头衔（管理员授予的勋章） ---------- */
.user-title {
  color: #8a6d1f;
  font-weight: 600;
  letter-spacing: .2px;
  margin-right: 2px;
  white-space: nowrap;
}
.badge-gold { background: #fdf6e3; color: #8a6d1f; border: 1px solid #ecd9a1; }

.title-form select {
  padding: 7px 8px; border: 1px solid #ccc; border-radius: 4px;
  background: #fff; font-size: 13.5px; font-family: inherit;
}
.title-cell { min-width: 190px; }
.title-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: #f7f7f7; border: 1px solid #e2e2e2; border-radius: 12px;
  padding: 1px 7px; margin: 0 4px 4px 0; font-size: 12.5px;
}
.title-chip.worn { background: #fdf6e3; border-color: #ecd9a1; }
.title-worn-note { color: #8a6d1f; font-size: 11px; }
.title-chip .tag-x { margin-left: 1px; }
.title-grant { display: inline-flex; gap: 4px; align-items: center; margin-top: 2px; }
.title-grant select { max-width: 108px; padding: 2px 4px; font-size: 12.5px; }

.worn-preview {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fafafa; border: 1px solid #e6e6e6; border-radius: 4px;
  padding: 10px 14px; margin: 14px 0 6px;
}
.worn-preview-label { color: #888; font-size: 13px; }
.worn-preview-name { font-size: 16px; }

.title-card {
  border: 1px solid #e4e4e4; border-radius: 4px; padding: 12px 16px;
  margin: 12px 0; background: #fff;
}
.title-card.worn { border-color: #ecd9a1; background: #fffdf6; }
.title-card-head { display: flex; align-items: center; gap: 8px; }
.title-name { font-size: 16px; }
.title-desc { margin: 6px 0 2px; color: #555; }
.title-card .dim { margin: 2px 0 0; font-size: 12px; }
.title-ops { margin-top: 8px; }

.title-edit { display: inline-block; margin-right: 6px; }
.title-edit summary {
  cursor: pointer; font-size: 12.5px; color: #666;
  border: 1px solid #ddd; border-radius: 4px; padding: 2px 8px; background: #fafafa;
  list-style: none; display: inline-block;
}
.title-edit summary::-webkit-details-marker { display: none; }
.title-edit[open] summary { background: #f0f0f0; }
.title-edit-form {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px; padding: 8px; background: #fafafa;
  border: 1px solid #e6e6e6; border-radius: 4px; max-width: 220px;
}
.title-edit-form input, .title-edit-form select {
  padding: 3px 6px; border: 1px solid #ccc; border-radius: 3px;
  font-size: 12.5px; font-family: inherit; background: #fff;
}

.table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-scroll .page-table { min-width: 780px; }

/* ---------- 个人资料：社交媒体账号 ---------- */
.social-fieldset {
  margin: 18px 0 0;
  padding: 12px 16px 16px;
  border: 1px solid #e5e5e5;
  border-radius: 5px;
  background: #fafafa;
}
.social-fieldset legend {
  padding: 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #555;
}
.social-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #888;
  line-height: 1.6;
}
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 18px;
}
.social-row label {
  margin: 6px 0 3px;
  font-size: 13px;
}
.social-row input[type=text] { font-size: 13.5px; }

.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}
.social-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 10px 2px 0;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  background: #fff;
  font-size: 12.5px;
  color: #444;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}
a.social-chip:hover { border-color: #bbb; background: #f3f3f3; color: #222; text-decoration: none; }
.social-chip .social-k {
  padding: 0 8px;
  margin-right: 8px;
  background: #f0f0f0;
  border-right: 1px solid #e0e0e0;
  border-radius: 12px 0 0 12px;
  color: #666;
}
.social-chip .social-v { text-overflow: ellipsis; overflow: hidden; }
.social-static { background: #fbfbfb; }
.social-inputs { display: grid; gap: 4px; }
.social-row-2 .social-inputs { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) {
  .social-grid { grid-template-columns: 1fr; }
  .social-row-2 .social-inputs { grid-template-columns: 1fr; }
}

/* ---------- 个人资料：贡献值热力图 ---------- */
.contrib {
  border: 1px solid #e5e5e5;
  border-radius: 5px;
  padding: 14px 16px 12px;
  background: #fff;
}
.contrib-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.contrib-total { margin: 0; font-size: 14px; color: #444; }
.contrib-total strong { color: #111; font-size: 16px; }
.contrib-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.contrib-pill {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
  background: #f4f4f4;
  border: 1px solid #e6e6e6;
  color: #555;
  white-space: nowrap;
}

.contrib-graph { display: flex; gap: 6px; margin-top: 14px; overflow: hidden; }
.contrib-weekdays {
  display: grid;
  grid-template-rows: 14px repeat(7, 14px);
  font-size: 10.5px;
  color: #999;
  text-align: right;
  flex: 0 0 auto;
}
.contrib-weekdays span { line-height: 14px; }
.contrib-body { flex: 0 0 auto; }
.contrib-months { display: block; white-space: nowrap; height: 14px; font-size: 0; }
.contrib-month { display: inline-block; width: 14px; font-size: 10.5px; color: #999; white-space: nowrap; vertical-align: top; }
.contrib-month.is-empty { visibility: hidden; }
.contrib-grid { display: block; white-space: nowrap; font-size: 0; }
.contrib-col { display: inline-block; vertical-align: top; width: 11px; margin-right: 3px; font-size: 0; }
.contrib-cell {
  display: block;
  margin-bottom: 3px;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: #ebedf0;
  outline: 1px solid rgba(27, 31, 35, .04);
}
.contrib-cell.lv-1 { background: #9be9a8; }
.contrib-cell.lv-2 { background: #40c463; }
.contrib-cell.lv-3 { background: #30a14e; }
.contrib-cell.lv-4 { background: #216e39; }
.contrib-cell.is-future { background: transparent; outline: 1px dashed #eee; }
.contrib-cell[data-date]:hover { outline: 1px solid #888; }

.contrib-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; align-items: center; margin-top: 8px; }
.contrib-since { font-size: 12px; color: #999; }
.contrib-legend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: #999; }

.contrib-pages { margin-top: 14px; border-top: 1px dashed #eee; padding-top: 10px; }
.contrib-pages h3 { font-size: 13.5px; color: #555; margin: 0 0 8px; font-weight: 600; }
.contrib-pages ul { list-style: none; margin: 0; padding: 0; }
.contrib-pages li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
}
.contrib-pages li a { flex: 0 0 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-bar {
  flex: 1 1 auto;
  height: 7px;
  max-width: 260px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}
.contrib-bar i { display: block; height: 100%; background: #57bb63; border-radius: 4px; }
.contrib-hint { margin: 10px 0 0; font-size: 11.5px; color: #aaa; line-height: 1.6; }

@media (max-width: 560px) {
  .contrib { padding: 12px; }
  .contrib-pages li a { max-width: 60%; }
}
.contrib-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; }
.contrib-scroll .contrib-grid { padding-right: 2px; }
.contrib-scroll::-webkit-scrollbar { height: 6px; }
.contrib-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* ---------- 地区同好群地图 ---------- */
.map-page .page-title { margin-bottom: 4px; }
.map-desc { color: #666; font-size: 13.5px; line-height: 1.7; margin: 0 0 10px; }
.map-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 6px 0 10px; font-size: 13px; color: #666;
}
.map-toolbar .map-total { margin-right: auto; }
.map-total { font-weight: 600; color: #444; }
.map-lang { background: #f2f2f2; border: 1px solid #e4e4e4; border-radius: 10px; padding: 1px 9px; }
.map-canvas { overflow-x: auto; overflow-y: hidden; }

.map-wrap {
  position: relative;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: linear-gradient(#fbfcfd, #f6f8fa);
  padding: 6px;
  overflow: hidden;
}
.world-map { width: 100%; height: auto; display: block; }
.map-grid line { stroke: #e3e9f0; stroke-width: .4; }
.map-land { fill: #dbe3ee; stroke: #fff; stroke-width: .3; pointer-events: none; }
.map-land.cont-europe { fill: #d8e1ec; }
.map-land.cont-africa { fill: #e8e0d2; }
.map-land.cont-samerica { fill: #dfe8d6; }
.map-land.cont-oceania { fill: #e8dcea; }
.map-country {
  fill: rgba(206, 218, 233, .98);
  stroke: #fff;
  stroke-width: .5;
  cursor: pointer;
  transition: fill .12s ease;
  vector-effect: non-scaling-stroke;
}
.map-country.cont-europe { fill: rgba(203, 216, 232, .98); }
.map-country.cont-africa { fill: rgba(226, 214, 193, .98); }
.map-country.cont-namerica { fill: rgba(205, 216, 232, .98); }
.map-country.cont-samerica { fill: rgba(210, 224, 197, .98); }
.map-country.cont-oceania { fill: rgba(226, 208, 228, .98); }
.map-country:hover { fill: #8fb3e0; stroke: #3f6ea8; stroke-width: .9; }
.map-country.is-active { fill: #f0b8b4; stroke: #c0564f; stroke-width: .7; }
.map-country.is-active:hover { fill: #e9a29d; }
.map-country.is-selected { fill: #d9534f; stroke: #8e332e; stroke-width: 1; }
.map-country.is-selected:hover { fill: #c94742; }
.map-dot { fill: #d9534f; stroke: #fff; stroke-width: .8; pointer-events: none; }
.map-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(255, 255, 255, .97);
  border: 1px solid #ddd; border-radius: 5px;
  padding: 6px 10px; font-size: 12.5px; color: #444;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  line-height: 1.6;
}
.map-tip strong { display: block; font-size: 13.5px; }
.map-tip span { color: #999; font-size: 11.5px; }
.map-tip em { display: block; font-style: normal; margin-top: 2px; color: #999; }
.map-tip em.has { color: #c0564f; }
.map-tip strong, .map-tip span { unicode-bidi: isolate; }
.map-hint { font-size: 12px; color: #999; margin: 6px 0 0; display: flex; align-items: center; gap: 5px; }
.map-legend-dot { width: 8px; height: 8px; border-radius: 50%; background: #d9534f; display: inline-block; }

.map-panel { margin-top: 18px; border-top: 1px solid #eee; padding-top: 12px; }
.map-region-title {
  font-size: 19px; margin: 0 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid #eee; color: #333;
  display: flex; align-items: center; gap: 8px;
}
.map-flag { font-size: 12px; font-family: Consolas, monospace; background: #f3f3f3;
  border: 1px solid #e3e3e3; padding: 1px 6px; border-radius: 4px; color: #777; }
.map-sub { font-size: 14px; color: #555; margin: 14px 0 8px; font-weight: 600; }
.group-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.group-card { border: 1px solid #e8e8e8; border-radius: 5px; padding: 10px 12px; background: #fcfcfc; }
.group-head { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.group-desc { margin: 4px 0 8px; font-size: 13px; color: #666; line-height: 1.65; white-space: pre-wrap; }
.group-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; }
.group-link { font-family: Consolas, monospace; background: #f4f4f4; padding: 2px 8px; border-radius: 4px; color: #444; }
.btn-sm { padding: 3px 10px; font-size: 12.5px; }

.apply-box { margin-top: 16px; border: 1px solid #e5e5e5; border-radius: 5px; background: #fafafa; padding: 10px 14px; }
.apply-box summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: #3a6ea5; }
.apply-desc { margin: 8px 0; font-size: 12.5px; }
.apply-form label { display: block; margin: 10px 0 4px; font-size: 13px; color: #666; font-weight: 600; }
.apply-form input[type=text], .apply-form textarea, .apply-form select {
  width: 100%; padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px;
  font-size: 13.5px; font-family: inherit; background: #fff;
}
.apply-form textarea { line-height: 1.6; }
.apply-form input:focus, .apply-form textarea:focus, .apply-form select:focus {
  outline: none; border-color: #999; box-shadow: 0 0 3px rgba(0, 0, 0, .1);
}

.region-columns { display: flex; flex-wrap: wrap; align-items: flex-start; margin: 0 -8px; }
.region-col { flex: 1 1 170px; min-width: 150px; max-width: 260px; padding: 0 8px; margin-bottom: 12px; box-sizing: border-box; }
.region-col h4 { font-size: 13px; color: #555; margin: 0 0 6px; }
.region-col ul { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.region-col li { padding: 2px 0; display: flex; justify-content: space-between; gap: 6px; line-height: 1.5; }
.region-col li .dim { color: #aaa; }
.region-col li a { color: #3a6ea5; }

.map-page.is-rtl { direction: rtl; text-align: right; }
.map-page.is-rtl .map-toolbar { flex-direction: row-reverse; }
.inline-form { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mini-input { width: 110px; padding: 3px 7px; border: 1px solid #ccc; border-radius: 3px; font-size: 12px; }
.admin-section .map-sub { margin-top: 18px; }

/* ------------------------------------------------------------------
   社区帖子（类 Twitter 时间线）
   ------------------------------------------------------------------ */
.av-post  { width: 42px; height: 42px; font-size: 18px; }
.av-reply { width: 32px; height: 32px; font-size: 14px; }
.posts-page { padding-top: 20px; }
.posts-top { border-bottom: 1px solid #eee; padding-bottom: 10px; }
.posts-desc { margin: 4px 0 0; font-size: 13px; }
.posts-author { display: flex; gap: 14px; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 14px; }
.posts-author .av-big { width: 64px; height: 64px; font-size: 28px; }
.posts-author .page-title { margin: 0 0 2px; }
.posts-author p { margin: 2px 0; }

.posts-tabs {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid #e8e8e8; margin: 14px 0 0;
}
.posts-tab {
  padding: 8px 14px; font-size: 14px; color: #666; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.posts-tab:hover { color: #1a5276; text-decoration: none; background: #fafafa; }
.posts-tab.is-on { color: #1a5276; font-weight: 600; border-bottom-color: #1a5276; }
.posts-search { margin-left: auto; display: flex; gap: 4px; padding: 4px 0; }
.posts-search input {
  width: 150px; padding: 3px 8px; font-size: 12.5px;
  border: 1px solid #ddd; border-radius: 3px; font-family: inherit;
}
.posts-q { margin: 10px 0 0; }

/* 发帖框 */
.composer { border: 1px solid #e2e2e2; border-radius: 6px; padding: 12px 14px; margin: 14px 0 6px; background: #fff; }
.composer-anon { font-size: 13.5px; color: #666; background: #fafafa; }
.composer-row { display: flex; gap: 10px; align-items: flex-start; }
.composer-field { flex: 1 1 auto; min-width: 0; width: auto; }
.composer textarea {
  display: block; width: 100%; box-sizing: border-box; border: none; outline: none; resize: vertical;
  font-family: inherit; font-size: 15px; line-height: 1.6; min-height: 62px; padding: 4px 0;
  color: #222; background: transparent;
}
.composer textarea::placeholder { color: #aaa; }
.composer-bar { display: flex; align-items: center; gap: 10px; border-top: 1px solid #f0f0f0; padding-top: 8px; }
.composer-tip { font-size: 11.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-count { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.composer-count.over { color: #c0392b; font-weight: 600; }
.composer .btn { flex-shrink: 0; }
.composer:not(.has-text) .btn { opacity: .55; }
.composer.no-ava .composer-field, .composer-row.no-ava .composer-field { flex-basis: 100%; }

/* 帖子卡片 */
.post-feed { margin-top: 6px; }
.post-card {
  display: flex; gap: 10px; padding: 14px 4px; border-bottom: 1px solid #f0f0f0;
  scroll-margin-top: 20px;
}
.post-card:hover { background: #fcfcfd; }
.post-ava a { display: block; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 14px; }
.post-name { font-weight: 700; color: #1a1a1a; }
.post-name:hover { text-decoration: underline; }
.post-handle { font-size: 12.5px; }
.post-dot { font-size: 12px; }
.post-time { font-size: 12.5px; color: #999; }
a.post-time:hover { text-decoration: underline; }
.post-kind { font-size: 10.5px; padding: 0 5px; }
.post-open { margin-left: auto; color: #bbb; font-size: 14px; opacity: 0; transition: opacity .12s; }
.post-card:hover .post-open { opacity: 1; }

.post-link { display: block; color: inherit; cursor: pointer; }
.post-link.is-detail { cursor: default; }
.post-link:focus-visible { outline: 2px solid #b8cfe6; outline-offset: 2px; border-radius: 4px; }
.post-text { font-size: 15px; line-height: 1.65; color: #222; margin-top: 3px; word-wrap: break-word; overflow-wrap: break-word; }
.post-text > p { margin: 0 0 .35em; }
.post-text > p:last-child { margin-bottom: 0; }
.post-text a { color: #1a5276; }
.post-text img.wiki-img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid #eee; margin: 4px 0; display: block; }
.post-text blockquote {
  margin: .4em 0; padding: 6px 12px; border-left: 3px solid #dcdcdc;
  background: #fafafa; color: #444; border-radius: 0 4px 4px 0;
}
.post-text ul, .post-text ol { margin: .3em 0 .5em; padding-left: 1.4em; }
.post-text pre.wikicode { font-size: 12.5px; }
.post-topic {
  display: inline-block; color: #1a5276; background: #eef4fa; border: 1px solid #dbe8f5;
  border-radius: 10px; padding: 0 6px; margin: 3px 4px 0 0; font-size: 12.5px;
  text-decoration: none;
}
.post-topic:hover { background: #e2edf8; text-decoration: none; }

/* 转发引用的原帖：外层 a 只有一处圆角框，内部一律不画边框 */
.post-quote {
  display: block; border: 1px solid #e6e6e6; border-radius: 10px; padding: 8px 10px;
  margin-top: 8px; color: inherit; background: #fbfbfb; cursor: pointer;
}
.post-quote:hover { background: #f6f8fb; border-color: #d8e2ee; }
.post-quote:focus-visible { outline: 2px solid #b8cfe6; outline-offset: 2px; }
.post-quote-gone { color: #999; font-size: 13px; }
.post-quote-head { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.post-quote-text { font-size: 13.5px; line-height: 1.55; color: #333; margin-top: 4px; }
.post-quote-text .post-text { font-size: 13.5px; line-height: 1.55; margin: 0; }
.post-quote-text p { margin: 0 0 .3em; }
.post-quote-text p:last-child { margin-bottom: 0; }
.post-quote-text .post-text img.wiki-img { max-height: 260px; }
.post-quote .post-topic { font-size: 12px; }
.post-quote .post-text { border: none; padding: 0; background: none; }
.post-quote .post-text > p { margin: 0 0 .3em; }
.post-quote .post-text > p:last-child { margin-bottom: 0; }

/* 操作行 */
.post-actions { display: flex; align-items: center; gap: 18px; margin-top: 8px; }
.post-act-form { display: inline; margin: 0; }
.post-act {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 3px 6px; margin: 0;
  font: inherit; font-size: 12.5px; color: #8a8a8a; cursor: pointer;
  border-radius: 4px; text-decoration: none; line-height: 1;
}
.post-act svg {
  width: 15px; height: 15px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.post-act.like svg { fill: none; }
.post-act.like.is-on svg { fill: #e05b4e; stroke: #c0392b; }
.post-act.is-on svg { stroke: #2e7d32; }
.post-act:hover { color: #1a5276; background: #f2f6fa; text-decoration: none; }
.post-act.like.is-on { color: #c0392b; }
.post-act.like.is-on:hover { background: #fdf1ef; }
.post-act.is-on { color: #2e7d32; }
.post-del { margin-left: auto; }
.post-del .post-act { padding: 3px 4px; }
.post-actions { min-height: 22px; }
.post-del .post-act { color: #bbb; }
.post-del .post-act:hover { color: #c0392b; background: #fdf1ef; }

.posts-empty { text-align: center; color: #999; font-size: 14px; padding: 40px 10px; }
.posts-pager { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 18px 0 4px; }
.posts-suggest { background: #fafafa; border: 1px solid #ececec; border-radius: 6px; padding: 12px 14px; margin: 10px 0; }
.posts-suggest h3 { margin: 0 0 8px; font-size: 13.5px; color: #555; }
.suggest-row { display: flex; flex-wrap: wrap; gap: 10px; }
.suggest-item { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin: 0; }

/* 帖子详情 */
.post-back { margin: 0 0 10px; font-size: 13px; }
.post-detail-page .post-card { border-bottom: 1px solid #eee; padding-top: 4px; }
.post-detail-page .post-text { font-size: 17px; line-height: 1.7; }
.post-detail-page .post-name { font-size: 15px; }
.post-sec { font-size: 14px; color: #555; margin: 22px 0 8px; font-weight: 600; }
.post-replies { border-top: 1px solid #eee; }
.reply-item { margin: 0; }
.reply-child { margin-left: 34px; border-left: 2px solid #f0f0f0; padding-left: 10px; }
.reply-card { padding: 10px 0; }
.reply-box { margin-top: 4px; }
.reply-box summary { cursor: pointer; font-size: 12.5px; padding: 3px 0; }
.reply-box .composer { margin: 6px 0 2px; padding: 8px 10px; background: #fafafa; }
.post-replies > .composer { padding: 10px 12px; }
.post-replies > .composer textarea { min-height: 46px; font-size: 14px; }
.post-likers { border-top: 1px solid #eee; }
.liker-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* 话题 */
.topic-head { border-bottom: 1px solid #eee; padding-bottom: 10px; }
.topic-related { margin: 8px 0 4px; font-size: 13px; }
.topic-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.topic-card {
  flex: 1 1 200px; max-width: 260px; border: 1px solid #e6e6e6; border-radius: 6px;
  padding: 10px 12px; color: inherit; background: #fff;
}
.topic-card:hover { border-color: #b8cfe6; background: #fafcfe; text-decoration: none; }
.topic-name { font-size: 15px; font-weight: 600; color: #1a5276; }
.topic-meta { font-size: 12.5px; margin-top: 3px; }
.topic-last { font-size: 11.5px; }

@media (max-width: 560px) {
  .post-card { padding: 12px 0; }
  .av-post { width: 36px; height: 36px; font-size: 15px; }
  .post-detail-page .post-text { font-size: 15.5px; }
  .posts-tabs { gap: 0; }
  .posts-tab { padding: 7px 10px; font-size: 13px; }
  .posts-search { width: 100%; margin-left: 0; }
  .posts-search input { flex: 1; width: auto; }
  .composer-tip { display: none; }
  .reply-child { margin-left: 14px; }
  .topic-card { max-width: none; }
}

/* ------------------------------------------------------------------
   变更日志
   ------------------------------------------------------------------ */
.log-head { border-bottom: 1px solid #eee; padding-bottom: 10px; }
.log-desc { margin: 4px 0 0; font-size: 13px; }
.log-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.log-stat {
  flex: 1 1 110px; max-width: 170px; border: 1px solid #ececec; border-radius: 6px;
  padding: 8px 12px; background: #fbfbfb;
}
.log-stat strong { display: block; font-size: 20px; color: #1a5276; line-height: 1.2; }
.log-stat span { font-size: 12px; color: #999; }

.log-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 6px; }
.log-filter select, .log-filter input[type="search"] {
  padding: 3px 8px; font-size: 12.5px; border: 1px solid #ddd; border-radius: 3px;
  font-family: inherit; background: #fff; color: #333; max-width: 160px;
}
.log-filter input[type="search"] { width: 180px; }
.log-count { margin-left: auto; font-size: 12.5px; }

.log-table { margin-top: 8px; }
.log-table th { font-size: 12.5px; white-space: nowrap; }
.log-table td { vertical-align: middle; font-size: 13px; }
.log-table tr.log-day td {
  background: #f6f7f9 !important; color: #888; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-top: 1px solid #e8e8e8;
}
.log-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-target { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.log-target a { color: #1a5276; }
.log-detail { color: #555; max-width: 340px; }
.log-actor { white-space: nowrap; }
.log-badge {
  display: inline-block; font-size: 11.5px; line-height: 1.6; padding: 0 7px;
  border-radius: 9px; border: 1px solid transparent; white-space: nowrap;
}
.log-green { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.log-blue  { background: #eef4fa; color: #1a5276; border-color: #dbe8f5; }
.log-gray  { background: #f2f2f2; color: #777; border-color: #e2e2e2; }
.log-empty { text-align: center; color: #999; padding: 28px 10px !important; }
.log-pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 16px 0 2px; }
.log-meta th { width: 110px; }
/* 日志页的内容卡片里放了宽表格，必须允许收缩，否则表格的 min-width 会把整页撑破 */
.wiki-page.log-page { min-width: 0; }

@media (max-width: 560px) {
  .log-filter select, .log-filter input[type="search"] { max-width: none; width: 100%; }
  .log-filter .btn { flex: 1 1 auto; }
  .log-count { margin-left: 0; width: 100%; }
  .log-stat { flex: none; box-sizing: border-box; width: calc(50% - 5px); max-width: none; padding: 7px 10px; }
  .log-stat strong { font-size: 18px; }
  .log-table th, .log-table td { font-size: 12.5px; padding-left: 8px; padding-right: 8px; }
  .log-target { max-width: 130px; }
  .log-detail { max-width: 220px; }
}

/* ------------------------------------------------------------------
   X 每日猫梗精选
   ------------------------------------------------------------------ */
.x-desc { margin: 4px 0 0; font-size: 13px; color: #666; }
.x-toolbar { display: flex; gap: 12px; align-items: center; margin: 12px 0 4px;
  flex-wrap: wrap; }
.x-toolbar .btn { white-space: nowrap; flex: 0 0 auto; }
.x-list { display: grid; gap: 18px; margin-top: 14px; }
.x-card { border: 1px solid #e5e5e5; border-radius: 8px; padding: 14px 16px 12px; background: #fff; }
.x-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.x-date { font-size: 12.5px; color: #888; }
.x-origin { font-size: 12.5px; color: #1a5276; }
.x-embed-quote { margin: 6px 0; }
.x-fallback { display: none; border-top: 1px dashed #eee; padding-top: 10px; }
.x-fb-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.x-fb-head strong { font-size: 13.5px; }
.x-fb-head .dim { font-size: 12.5px; }
.x-av { display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
  background: #1a5276; color: #fff; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; }
.x-fb-text { font-size: 14px; line-height: 1.55; margin-bottom: 8px; word-break: break-word; }
.x-tag { color: #1a5276; }
img.x-media { display: block; width: 100%; max-width: 480px; border-radius: 8px;
  border: 1px solid #eee; margin: 0 0 8px; background: #fafafa; height: auto; }
/* 竖屏视频按高度收敛，避免一条视频占满整屏 */
video.x-media { display: block; width: auto; max-width: 100%; max-height: min(70vh, 520px);
  border-radius: 8px; border: 1px solid #eee; margin: 0 0 8px; background: #000; }
.x-actions { display: flex; gap: 14px; align-items: center; margin: 6px 0 2px; }
.x-like-form { display: inline; }
.x-like-btn { display: inline-flex; gap: 4px; align-items: center; background: none;
  border: 1px solid #e3e3e3; border-radius: 14px; padding: 2px 10px; cursor: pointer;
  color: #888; font-size: 13px; font-family: inherit; }
.x-like-btn:hover { border-color: #e08080; color: #c0392b; }
.x-like-btn.liked { color: #c0392b; border-color: #eec4c0; background: #fdf3f2; }
.x-origin-like { font-size: 12px; }
.x-comments { border-top: 1px solid #f0f0f0; margin-top: 8px; padding-top: 8px; }
.x-comment { display: flex; gap: 8px; align-items: baseline; font-size: 13px;
  padding: 3px 0; }
.x-c-body { flex: 1; word-break: break-word; }
.x-c-form { display: flex; gap: 6px; margin-top: 8px; }
.x-c-form input { flex: 1 1 auto; min-width: 0; padding: 6px 9px; border: 1px solid #ddd;
  border-radius: 4px; font-family: inherit; font-size: 13px; }
.x-c-form .btn { flex: 0 0 auto; white-space: nowrap; }
.x-c-tip { font-size: 12.5px; margin: 8px 0 0; }
.x-empty { margin: 20px 0; }
.x-archive { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.x-arch-item { font-size: 12.5px; border: 1px solid #e5e5e5; border-radius: 12px;
  padding: 2px 10px; color: #555; }
.x-arch-item:hover { border-color: #1a5276; color: #1a5276; }
.x-arch-view { margin-top: 16px; border: 1px solid #eee; border-radius: 8px;
  padding: 14px 16px; background: #fcfcfc; }
.x-arch-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.x-arch-card { margin-bottom: 14px; }
.x-add-form { display: grid; gap: 8px; margin: 14px 0 20px; justify-items: start; }
.x-add-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid #ddd; border-radius: 4px; font-family: inherit; font-size: 13px; }
.x-pool-body { max-width: 420px; overflow: hidden; text-overflow: ellipsis;
  font-size: 12.5px; color: #555; }
/* 页面完全自包含：正文、图片、视频、头像全部由本站提供，
   不加载任何 X 外部脚本与资源，境内网络也能完整浏览。 */
.x-beluga { border: 1.5px solid #cfd8dc; border-radius: 10px; background: #f7fafc;
  padding: 14px 16px; margin: 16px 0 6px; }
.x-beluga-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  margin-bottom: 10px; }
.x-beluga-head h2 { margin: 0; font-size: 17px; }
.x-trans { font-size: 13.5px; line-height: 1.55; color: #4a5a6a; background: #f2f7fb;
  border-left: 3px solid #7fb3d5; border-radius: 0 6px 6px 0; padding: 6px 10px;
  margin: 0 0 8px; word-break: break-word; }
.x-trans-tag { display: inline-block; font-size: 11px; color: #fff; background: #7fb3d5;
  border-radius: 3px; padding: 0 5px; margin-right: 6px; vertical-align: 1px; }
.x-beluga-empty { margin: 4px 0 2px; }
.x-replay { font-size: 12.5px; color: #8a6d1f; background: #fdf6e3;
  border: 1px solid #f0e2bd; border-radius: 10px; padding: 1px 9px; }
.x-av-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  flex: 0 0 auto; background: #eee; display: block; }
.x-av-img + .x-av { margin-right: 0; }
.x-media[src=""] { display: none; }
@media (max-width: 560px) {
  .x-card { padding: 12px; }
  .x-media { max-width: none; }
}

/* —— YouTube 搬运页 —— */
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px; margin-top: 14px; }
.yt-card { border: 1px solid #e5e5e5; border-radius: 8px; background: #fff;
  overflow: hidden; }
.yt-stage { position: relative; background: #000; line-height: 0; }
.yt-video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto;
  background: #000; }
.yt-dur { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .72);
  color: #fff; font-size: 11.5px; line-height: 1.5; padding: 1px 6px;
  border-radius: 3px; font-variant-numeric: tabular-nums; }
.yt-meta { padding: 10px 12px 2px; }
.yt-title { font-size: 14.5px; line-height: 1.4; margin: 0 0 5px; }
.yt-title-zh { font-size: 13.5px; line-height: 1.5; color: #3f4f5f; background: #f2f7fb;
  border-left: 3px solid #7fb3d5; border-radius: 0 5px 5px 0; padding: 5px 9px;
  margin: 0 0 7px; }
.yt-sub { font-size: 12px; margin: 0 0 6px; }
.yt-cmt-wrap { border-top: 1px solid #f0f0f0; margin: 0 12px 10px; padding-top: 6px;
  font-size: 12.5px; }
.yt-cmt-wrap summary { cursor: pointer; color: #1a5276; padding: 2px 0; }
.yt-cmt-wrap .x-comments { border-top: 0; margin-top: 4px; padding-top: 4px; }
@media (max-width: 640px) {
  .yt-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* —— YouTube 播放器：点击封面才加载源文件 —— */
.yt-play { position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; border: 0; cursor: pointer; color: #fff; font: inherit; line-height: 1.4;
  background: linear-gradient(180deg, rgba(0, 0, 0, .16), rgba(0, 0, 0, .42));
  transition: background .15s; }
.yt-play:hover { background: rgba(0, 0, 0, .52); }
.yt-loaded .yt-play { display: none; }
/* 加载失败时保留可点击的遮罩，文案变为「点击重试」 */
.yt-error { background: #1b1b1b; }
.yt-error .yt-video { visibility: hidden; }
.yt-play-ico { width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, .94);
  color: #111; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .32); }
.yt-play-txt { font-size: 12.5px; letter-spacing: .3px; color: #fff;
  background: rgba(0, 0, 0, .5); border-radius: 10px; padding: 2px 10px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }

/* —— 管理员手动搬运面板 —— */
.yt-admin { margin: 14px 0 4px; border: 1px solid #e3e8ee; border-radius: 10px;
  background: #f8fafc; padding: 12px 14px; }
.yt-admin-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  margin-bottom: 9px; }
.yt-jobs { display: flex; flex-direction: column; gap: 6px; max-height: 336px;
  overflow-y: auto; padding-right: 2px; }
.yt-job { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid #eceff3; border-radius: 7px;
  padding: 6px 9px; font-size: 13px; }
.yt-job-t { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.yt-job-n { flex: 0 1 auto; font-size: 11.5px; color: #a0522d; }
.yt-job-s { flex: 0 0 auto; font-size: 11.5px; border-radius: 10px; padding: 1px 8px;
  background: #eef2f6; color: #5a6b7b; white-space: nowrap; }
.yt-job-s.s-downloading { background: #e8f2fb; color: #1a5276; }
.yt-job-s.s-failed { background: #fdecea; color: #a93226; }
.yt-job-s.s-skipped { background: #fdf6e3; color: #8a6d1f; }
.yt-admin-foot { display: flex; gap: 10px; align-items: center; margin-top: 9px;
  flex-wrap: wrap; }
.yt-jobs-empty { margin: 2px 0; }
@media (max-width: 640px) {
  .yt-job-t { flex: 1 1 100%; }
  .yt-admin { padding: 10px 11px; }
}
