/* ============ 论坛布局 ============ */
body {
  display: block;
  padding: 0;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============ 顶栏 ============ */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

.brand {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  gap: 16px;
  flex: 1;
}

.topbar nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  padding: 4px 2px;
}

.topbar nav a.active,
.topbar nav a:hover {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  white-space: nowrap;
}

/* 顶栏搜索框容器：默认定宽，首页宽屏（顶栏导航隐藏时）放开撑满 */
.topbar-search {
  max-width: 340px;
}

.user-area .username {
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 工具栏与板块 ============ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-tab {
  padding: 6px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.category-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

/* ============ 帖子列表 ============ */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.post-item:hover {
  background: #f9fafb;
}

.post-main {
  flex: 1;
  min-width: 0;
}

.post-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-title:hover {
  color: var(--primary);
}

.post-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.post-meta .cat {
  color: var(--primary);
  margin-right: 8px;
}

.post-stats {
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.post-stats .replies {
  font-weight: 700;
  color: var(--text);
}

/* ============ 分页 ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 0 30px;
  font-size: 14px;
  color: var(--muted);
}

/* ============ 帖子详情 ============ */
.thread-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.thread-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.4;
  word-break: break-word;
}

.thread-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.thread-content {
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

/* ============ 回复 ============ */
.reply-item {
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}

.reply-item .reply-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.reply-item .reply-author {
  font-weight: 600;
  color: var(--text);
}

.reply-item .reply-content {
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.reply-form textarea {
  min-height: 90px;
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  outline: none;
}

.reply-form textarea:focus {
  border-color: var(--primary);
}

.reply-form .form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

/* ============ 表单页（发帖） ============ */
.form-title {
  font-size: 20px;
  margin: 0 0 16px;
}

select.field-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

textarea.field-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 180px;
  resize: vertical;
  outline: none;
}

textarea.field-input:focus,
select.field-input:focus {
  border-color: var(--primary);
}

/* ============ 空状态 ============ */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 15px;
}

/* ============ 头像 ============ */
.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  background: #f1f5f9;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  user-select: none;
  vertical-align: middle;
  flex: none;
}

.avatar-xs { width: 20px; height: 20px; font-size: 11px; }
.avatar-sm { width: 28px; height: 28px; font-size: 13px; }
.avatar-md { width: 44px; height: 44px; font-size: 18px; }
.avatar-lg { width: 96px; height: 96px; font-size: 34px; }

.post-meta .avatar-xs,
.post-meta .avatar-fallback {
  margin-right: 5px;
}

.post-author {
  font-weight: 500;
  color: var(--text);
}

.thread-meta .avatar-sm {
  margin-right: 6px;
}

.reply-head .avatar-xs {
  margin-right: 6px;
}

/* 顶栏用户区链接 */
.user-area .user-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.user-area .user-link:hover {
  color: var(--primary);
}

.user-area .username {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 个人资料页 ============ */
.profile-card {
  max-width: 640px;
  padding: 28px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap; /* 【关键修复】允许内部元素换行，解决挤压问题 */
}

.profile-avatar {
  flex: none;
  text-align: center;
}

.profile-avatar .avatar-lg {
  display: block;
}

.profile-fields {
  flex: 1;
  min-width: 240px; /* 【关键修复】防止右侧内容被过度压缩 */
}

.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 15px;
}

.field-row label {
  width: 72px;
  flex: none;
  color: var(--muted);
  font-size: 14px;
}

.field-row span {
  white-space: nowrap; /* 【关键修复】强制“注册时间”等文字不折行 */
}

.field-row .field-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
}

.field-row .field-input:focus {
  border-color: var(--primary);
}

/* 【关键修复】底部按钮区独占一行，并增加分割线 */
.profile-actions {
  width: 100%;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.profile-actions .error,
.profile-actions .ok {
  width: 100%;
  margin: 0 !important;
}

/* ============ 管理后台 ============ */
.stat-cards {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-tab {
  padding: 7px 18px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.admin-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: #f9fafb;
}

.admin-table .td-title {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table .td-title a {
  color: var(--text);
  text-decoration: none;
}

.admin-table .td-title a:hover {
  color: var(--primary);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-admin {
  background: #fef3c7;
  color: #92400e;
}

.badge-user {
  background: #e2e8f0;
  color: #475569;
}

.btn-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  width: auto;
  margin: 0;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-sm {
  padding: 3px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* 成功提示 */
.ok {
  color: #16a34a;
  font-size: 14px;
  margin: 0 0 12px;
}

/* ============ UI 优化（整体视觉升级） ============ */

/* 顶栏：悬浮阴影 + 品牌渐变 */
.topbar {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

.brand {
  color: var(--primary);
}

@supports (-webkit-background-clip: text) {
  .brand {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.topbar nav a {
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

/* 首页帖子列表：卡片化 */
.post-list {
  gap: 10px;
}

.post-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 16px;
  margin: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}

.post-item:hover {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.category-tab {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* 帖子详情 / 回复卡片微调 */
.thread {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.reply-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.reply-form.card {
  border-radius: 12px;
}

/* 管理后台：统计卡片渐变 */
.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  border: 1px solid #dbeafe;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
  transition: transform 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-num {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* 管理表格：斑马纹 + 行内操作 */
.admin-table thead th {
  background: #f8fafc;
}

.admin-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.admin-table tbody tr:hover {
  background: #f0f6ff;
}

.admin-table .td-actions {
  white-space: nowrap;
}

.admin-table .td-actions .btn {
  margin-right: 6px;
}

/* 按钮统一过渡 */
.btn {
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* ============ 帖子 UI 升级 ============ */

/* 板块彩色标签 */
.cat {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.cat-1 { background: #dbeafe; color: #1d4ed8; }   /* 技术交流 蓝 */
.cat-2 { background: #dcfce7; color: #15803d; }   /* 生活闲聊 绿 */
.cat-3 { background: #fef3c7; color: #b45309; }   /* 学习分享 橙 */
.cat-4 { background: #fee2e2; color: #b91c1c; }   /* 站务反馈 红 */

/* 帖子卡片：左主区 + 缩略图 + 右侧回复徽章 */
.post-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
}

.post-main {
  flex: 1;
  min-width: 0;
}

.post-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.post-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}

.post-title:hover {
  color: var(--primary);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.post-meta .dot {
  color: #d1d5db;
}

.post-author {
  color: var(--text);
  font-weight: 500;
}

/* 列表缩略图 */
.post-thumb {
  width: 108px;
  height: 78px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* 回复数徽章 */
.post-stats {
  flex-shrink: 0;
  text-align: center;
  min-width: 52px;
}

.post-stats .replies {
  display: inline-block;
  min-width: 26px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.post-stats .replies-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* 板块导航胶囊 */
.category-tab {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.category-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* 帖子详情：标题 + 作者信息条 */
.thread-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.thread-title-row h2 {
  margin: 0;
  font-size: 22px;
}

.thread-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.thread-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-author-sub {
  font-size: 12px;
  color: var(--muted);
}

.thread-content {
  margin-top: 16px;
  line-height: 1.8;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-image {
  display: block;
  max-width: 100%;
  max-height: 520px;
  margin: 18px auto 0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* 回复：楼层徽章 */
.floor-badge {
  display: inline-block;
  min-width: 34px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.reply-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.reply-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text);
}

.reply-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

/* 发帖配图上传区 */
.image-preview {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.image-preview img {
  max-width: 240px;
  max-height: 160px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.muted {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
}

/* ===== 搜索与新增控件（完善版） ===== */
.toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.search-input {
  width: 200px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.post-stats .views {
  font-weight: 600;
  color: var(--primary);
  margin-left: 8px;
}

.post-stats .views-label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 4px;
}

.thread-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  cursor: pointer;
}

.reply-head .reply-del {
  margin-left: 8px;
}
/* ================= 让整个帖子卡片可点击 ================= */

/* 1. 让卡片成为定位参考系 */
.post-item {
  position: relative;
  cursor: pointer; /* 鼠标移上去变成小手 */
}

/* 2. 利用伪元素，把标题链接铺满整个卡片 */
.post-title::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* 3. 如果以后卡片里有其他按钮（比如删除），需要提升层级防止被覆盖 */
.post-item .btn,
.post-item button {
  position: relative;
  z-index: 2;
}
/* ================= 弹窗 (Modal) 样式 ================= */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay[hidden] {
  display: none !important;
}
.modal-content {
  background: #fff;
  width: 100%;
  max-width: 460px;
  margin: 16px;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25), 0 2px 8px rgba(15, 23, 42, 0.08);
  animation: modalFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.close-btn:hover {
  color: var(--danger);
  background: #fef2f2;
}

.modal-body {
  padding: 24px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

/* 弹窗内表单字段 */
.modal-body .field {
  margin-bottom: 18px;
}
.modal-body .field:last-of-type {
  margin-bottom: 6px;
}
.modal-body .field label {
  display: block;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 7px;
  font-weight: 500;
}
.modal-body .field .field-input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.modal-body .field .field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.modal-body .field textarea.field-input {
  height: auto;
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
}

/* 弹窗底部按钮组 */
.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.modal-footer .btn {
  flex: 1;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

/* ================= 生日选择器（大厂风格三级联动） ================= */
.birthday-picker {
  display: flex;
  gap: 8px;
  align-items: center;
}
.birthday-picker select {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.birthday-picker select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.birthday-picker .picker-sep {
  color: var(--muted);
  font-size: 14px;
  flex: 0 0 auto;
}

/* 生日选择辅助行：可见性勾选 + 清除 */
.birthday-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.birthday-tools .clear-birthday {
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.birthday-tools .clear-birthday:hover {
  text-decoration: underline;
}

/* 现代勾选框：checkbox 与文字同一行垂直居中 */
.modern-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text, #333);
  cursor: pointer;
  user-select: none;
}
.modern-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

/* 弹窗内提示信息 */
.modal-body .error,
.modal-body .ok {
  font-size: 13px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  display: block;
}
.modal-body .error {
  color: #dc2626;
  background: #fef2f2;
}
.modal-body .ok {
  color: #16a34a;
  background: #f0fdf4;
}

/* 调整表单输入框 */
textarea.field-input {
  min-height: 80px;
  resize: vertical;
}

/* ============ 整体 UI 升级（卡片式回复） ============ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --danger: #ef4444;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e5e7eb;
  --bg: #ffffff;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
}

body {
  background: var(--bg);
}

/* 首页帖子列表区域用浅灰背景 */
.post-list {
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px;
}

/* 顶栏优化 */
.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0, 0, 0, 0.03);
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* 帖子详情主卡片（贴吧风格：无卡片背景，直接在页面上） */
.thread {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  transition: none;
}

.thread:hover {
  box-shadow: none;
}

.thread-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

/* 作者行：头像 + 昵称 + 时间 */
.post-author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.post-author-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-author-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.post-author-time {
  font-size: 12px;
  color: var(--muted);
}

.post-title-h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px;
  letter-spacing: -0.2px;
  color: var(--text);
}

.thread-content {
  font-size: 15.5px;
  line-height: 1.85;
  color: #1e293b;
  margin-top: 0;
  padding-bottom: 0;
}

/* 底部操作栏 */
.post-actions-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 14px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.post-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.15s;
}

.post-action:hover {
  color: var(--primary);
}

.post-action.liked {
  color: var(--danger);
}

.post-more-btn {
  margin-left: auto;
}

/* 顶部固定栏（贴吧风格：返回箭头 + 标题） */
.thread-sticky-top {
  position: sticky;
  top: 64px;
  z-index: 50;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  margin-bottom: 8px;
}

.back-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;
}

.back-circle-btn:hover {
  background: #e2e8f0;
}

.sticky-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 回复区头部 sticky 固定 */
.reply-header {
  position: sticky;
  top: 110px;
  z-index: 50;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.reply-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* 排序按钮组 */
.reply-sort-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
}

.sort-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.sort-tab.active {
  background: #fff;
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 顶部回复输入框 */
.reply-input-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
  padding: 10px;
  background: #f1f5f9;
  border-radius: 12px;
}

.reply-input-bar .reply-input {
  flex: 1;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  resize: none;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.reply-input-bar .reply-input:focus {
  border-color: var(--primary);
}

.reply-input-bar .reply-input:disabled {
  cursor: pointer;
  background: #f8fafc;
}

.reply-input-bar .reply-send-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.reply-input-bar .reply-send-btn:hover {
  background: var(--primary-dark);
}

/* 底部固定输入框 */
.bottom-reply-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  padding: 12px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  animation: slideUp 0.25s ease;
}

.bottom-reply-bar .reply-input-bar {
  max-width: 800px;
  margin: 0 auto;
  margin-bottom: 0;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ====== 回复区：贴吧风格（分隔线，无卡片背景） ====== */

/* 每条回复 */
.reply-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  box-shadow: none;
  transition: none;
}

.reply-item:hover {
  box-shadow: none;
}

/* 子回复（楼中楼）：缩进 */
.reply-child {
  margin-left: 40px;
  background: transparent;
  border-bottom: 1px solid #f1f5f9;
}

.reply-body {
  flex: 1;
  min-width: 0;
}

.reply-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.reply-text {
  font-size: 14.5px;
  color: #1e293b;
  margin-top: 3px;
  line-height: 1.6;
  word-break: break-word;
}

.reply-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.reply-actions {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
}

.reply-actions span {
  cursor: pointer;
  transition: color 0.15s;
}

.reply-actions .reply-like:hover,
.reply-actions .reply-action:hover {
  color: var(--primary);
}

.reply-actions .reply-del {
  color: var(--danger);
}

.reply-actions .reply-del:hover {
  color: #b91c1c;
}

/* 展开按钮 */
.expand-thread {
  margin-left: 40px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  text-align: center;
  background: var(--primary-light);
  border-radius: 8px;
  transition: background 0.15s;
}

.expand-thread:hover {
  background: #e0e7ff;
}

.hidden-thread {
  display: none;
}

/* 回复操作按钮 */
.reply-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.reply-like,
.reply-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s;
}

.reply-like:hover,
.reply-action:hover {
  color: var(--primary);
}

.reply-like.liked {
  color: var(--danger);
}

.reply-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.reply-more:hover {
  background: #f1f5f9;
  color: var(--text);
}

/* 弹出菜单 */
.reply-menu {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 6px;
  min-width: 120px;
  animation: menuFadeIn 0.15s ease-out;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.reply-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.reply-menu-item:hover {
  background: #f1f5f9;
}

.reply-menu-item.reply-menu-del {
  color: var(--danger);
}

.reply-menu-item.reply-menu-del:hover {
  background: #fef2f2;
}

/* 底部回复输入框优化 */
#reply-form textarea {
  background: #f1f5f9;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

#reply-form textarea:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#reply-form .btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

#reply-form .btn-primary:hover {
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* 首页帖子卡片优化 */
.post-item {
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.post-item:hover {
  border-color: #c7d2fe;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.12);
  transform: translateY(-2px);
}

/* 帖子详情主卡片 hover 微效果 */
.thread {
  transition: box-shadow 0.25s ease;
}

.thread:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 回复卡片 hover */
.reply-item {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.reply-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* 点赞按钮点击弹跳动画（只在点击时播放） */
@keyframes likePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.like-anim {
  animation: likePop 0.3s ease;
}

.reply-like.liked {
  color: var(--danger);
}

#like-btn.liked {
  color: var(--danger);
}

.post-title {
  font-size: 16px;
  font-weight: 600;
}

/* 板块标签 */
.category-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
}

/* 按钮主色统一 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #4f46e5 100%);
}

/* 品牌渐变 */
@supports (-webkit-background-clip: text) {
  .brand {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* 头像 / 用户名：可点击进入对方主页 */
[data-user-pop] {
  cursor: pointer;
}

/* 列表页页头（与首页板块栏同一种白卡片风格） */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.page-head-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.page-head-action {
  font-size: 14px;
  color: #4e6ef2;
  text-decoration: none;
}
.page-head-action:hover { text-decoration: underline; }

/* 列表页空状态（贴吧风：裸文字，不要白色卡片模块） */
.empty {
  padding: 60px 16px;
  text-align: center;
  color: #999;
  font-size: 14px;
  margin-bottom: 10px;
}

/* =========================================================
   统一帖子卡片：首页 / 我的帖子 / 搜索结果 / 个人主页共用
   （首页 SSR 与 post-card.js 渲染出的结构保持同一套类名）
   ========================================================= */
.post-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.post-card:hover {
  border-color: #d6ddff;
  box-shadow: 0 4px 16px rgba(78, 110, 242, 0.08);
}

.pc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pc-avatar-wrap {
  display: inline-flex;
  line-height: 0;
  cursor: pointer;
  flex: 0 0 auto;
}
.pc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #eef2ff;
}
.pc-avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4e6ef2;
  font-size: 14px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
}
.pc-meta { flex: 1; min-width: 0; }
.pc-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.pc-sub {
  font-size: 12px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.pc-cat {
  color: #4e6ef2;
  background: #eef2ff;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.pc-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #999;
  cursor: pointer;
  flex: 0 0 auto;
}
.pc-more:hover { background: #f2f3f5; }

.pc-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  line-height: 1.45;
  display: block;
}
.pc-title:hover { color: #4e6ef2; }
.pc-excerpt {
  font-size: 14px;
  color: #666;
  margin-top: 6px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-img-single {
  width: 300px;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  cursor: pointer;
  margin: 12px 0;
}
.pc-imgs {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  align-items: start;
}
.pc-imgs.cols-2 { grid-template-columns: 1fr 1fr; }
.pc-imgs.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.pc-img {
  width: 100%;
  height: 300px;
  object-fit: contain;
  background: #f7f8fa;
  border-radius: 6px;
  display: block;
  cursor: pointer;
}

.pc-footer {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f2f3f5;
  font-size: 13px;
  color: #666;
}
.pc-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}
.pc-stat:hover { color: #4e6ef2; }
.pc-stat .like-count { display: inline; }
/* 封禁通知「我要申诉」入口 */
.notif-appeal-btn {
  margin-top: 6px;
  padding: 3px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #4e6ef2;
  font-size: 12px;
  line-height: 1.5;
  font-family: inherit;
  cursor: pointer;
}
.notif-appeal-btn:hover { border-color: #4e6ef2; }
.notif-appeal-btn:disabled { opacity: .6; cursor: default; border-color: #e5e7eb; }

/* 申诉弹窗 */
.appeal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .38);
  box-sizing: border-box;
}
.appeal-modal {
  width: 420px;
  max-width: 100%;
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  box-sizing: border-box;
  box-shadow: 0 14px 44px rgba(20, 30, 50, .16);
}
.appeal-title { font-size: 17px; font-weight: 700; color: #1f2329; }
.appeal-sub { margin-top: 7px; font-size: 12.5px; line-height: 1.65; color: #8a93a3; }
.appeal-textarea {
  width: 100%;
  height: 112px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-sizing: border-box;
  resize: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  color: #1f2329;
}
.appeal-textarea:focus { border-color: #4e6ef2; }
.appeal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.appeal-btn {
  padding: 8px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.appeal-btn:hover { border-color: #4e6ef2; color: #4e6ef2; }
.appeal-btn.primary { border-color: #4e6ef2; background: #4e6ef2; color: #fff; font-weight: 600; }
.appeal-btn.primary:hover { border-color: #3f5ee0; background: #3f5ee0; color: #fff; }
.appeal-btn:disabled { opacity: .6; cursor: default; }