* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  font-size: 14px;
}

.hidden { display: none !important; }

/* 容器适配 */
.container {
  max-width: 750px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}

/* 顶部栏 */
.header {
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-btn {
  background: #1677ff;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
}

/* 内容区 */
.content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 70px;
}

.page {
  padding: 12px;
}

/* 底部导航 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 750px;
  height: 60px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  z-index: 10;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #999;
  font-size: 12px;
}

.tab-item.active {
  color: #1677ff;
}

.tab-item div {
  font-size: 20px;
}

/* 弹窗通用 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  resize: none;
}

input:focus, textarea:focus {
  border-color: #1677ff;
}

.primary-btn {
  width: 100%;
  padding: 10px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.switch-text {
  text-align: center;
  color: #1677ff;
  font-size: 12px;
  cursor: pointer;
}

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

.post-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #f0f0f0;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
}

.post-user-info {
  flex: 1;
}

.post-nickname {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-tag {
  background: #1677ff;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.top-tag {
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.post-time {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.post-content {
  line-height: 1.6;
  margin-bottom: 10px;
  word-break: break-all;
}

.post-media {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.post-media img, .post-media video {
  width: 100%;
  border-radius: 6px;
  object-fit: cover;
  max-height: 120px;
}

.post-footer {
  display: flex;
  gap: 16px;
  color: #666;
  font-size: 12px;
  border-top: 1px solid #f5f5f5;
  padding-top: 10px;
}

.post-footer div {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-footer .liked {
  color: #ff4d4f;
}

.post-admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f5f5f5;
}

.post-admin-actions button {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

/* 评论区 */
.comment-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f5f5f5;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.comment-item {
  display: flex;
  gap: 8px;
  font-size: 12px;
}

.comment-item .avatar {
  width: 28px;
  height: 28px;
}

.comment-content {
  flex: 1;
  background: #f7f8fa;
  padding: 8px;
  border-radius: 6px;
}

.comment-nickname {
  font-weight: 500;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.reply-text {
  color: #1677ff;
  cursor: pointer;
  margin-left: 4px;
}

.comment-input-bar {
  display: flex;
  gap: 8px;
}

.comment-input-bar input {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
}

.comment-input-bar button {
  padding: 0 12px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

/* 悬浮发帖按钮 */
.fab-btn {
  position: fixed;
  bottom: 80px;
  right: calc(50% - 345px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1677ff;
  color: #fff;
  border: none;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(22,119,255,0.4);
  cursor: pointer;
  z-index: 9;
}

@media (max-width: 750px) {
  .fab-btn { right: 20px; }
}

/* 上传区域 */
.upload-area {
  margin: 8px 0;
}

.upload-btn {
  display: inline-block;
  padding: 8px 16px;
  background: #f0f5ff;
  color: #1677ff;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.upload-btn.small {
  padding: 4px 10px;
  font-size: 12px;
}

.preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.preview-list img, .preview-list video {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

/* 聊天室 */
.chat-list {
  height: calc(100vh - 130px);
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-item {
  display: flex;
  gap: 8px;
  max-width: 80%;
}

.chat-item.mine {
  flex-direction: row-reverse;
  margin-left: auto;
}

.chat-item .avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.chat-bubble {
  background: #f0f0f0;
  padding: 8px 12px;
  border-radius: 10px;
  word-break: break-all;
}

.chat-item.mine .chat-bubble {
  background: #1677ff;
  color: #fff;
}

.chat-nickname {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.chat-item.mine .chat-nickname {
  text-align: right;
}

.chat-media img, .chat-media video {
  max-width: 200px;
  border-radius: 6px;
  margin-top: 4px;
}

.chat-delete-btn {
  font-size: 11px;
  color: #ff4d4f;
  cursor: pointer;
  margin-top: 4px;
}

.chat-input-bar {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 750px;
  background: #fff;
  padding: 8px 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-bar input {
  flex: 1;
}

.chat-input-bar button {
  padding: 8px 16px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.chat-upload {
  font-size: 20px;
  cursor: pointer;
}

/* 个人中心 */
.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(135deg, #1677ff, #69b1ff);
  color: #fff;
  border-radius: 10px;
  margin-bottom: 16px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
}

.nickname-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 16px;
}

.user-card .tip {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}

.setting-list {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.setting-item {
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.setting-item > span:first-child {
  width: 80px;
  color: #333;
}

.setting-item input {
  flex: 1;
  min-width: 120px;
}

.setting-item button {
  padding: 6px 14px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.setting-icon-preview {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f0f0;
  border: 1px solid #eee;
}

.setting-item:last-child {
  border-bottom: none;
}
/* 搜索框样式 */
.search-bar {
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  background: #f5f7fa;
  padding: 4px 0 8px;
  z-index: 5;
}

.search-bar input {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
}

/* 封禁按钮样式 */
.ban-btn {
  color: #ff4d4f;
  border-color: #ffccc7 !important;
}

.ban-btn.unban {
  color: #52c41a;
  border-color: #b7eb8f !important;
}

.banned-tag {
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 消息页与未读红圈 */
.tab-icon-wrap, .avatar-wrap {
  position: relative;
  display: inline-flex;
}

.badge, .avatar-badge, .avatar-dot {
  position: absolute;
  background: #ff4d4f;
  color: #fff;
  border: 2px solid #fff;
}

.badge {
  min-width: 18px;
  height: 18px;
  line-height: 14px;
  border-radius: 10px;
  top: -8px;
  right: -14px;
  font-size: 10px !important;
  text-align: center;
  padding: 0 4px;
}

.avatar-badge {
  min-width: 18px;
  height: 18px;
  line-height: 14px;
  border-radius: 10px;
  right: -4px;
  top: -4px;
  font-size: 10px;
  text-align: center;
  padding: 0 4px;
}

.avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  right: 0;
  top: 0;
}

.message-section {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 10px;
}

.text-btn {
  border: none;
  background: transparent;
  color: #1677ff;
  font-size: 12px;
}

.top-post-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.top-post-pill {
  flex: 0 0 auto;
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 20px;
  padding: 7px 10px;
  cursor: pointer;
}

.notification-list, .session-list, .user-search-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item, .user-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #f7f8fa;
  cursor: pointer;
}

.notification-item.unread {
  background: #fff1f0;
}

.notification-main, .user-row-main {
  flex: 1;
  min-width: 0;
}

.notification-content, .session-last, .empty-tip {
  color: #999;
  font-size: 12px;
  margin-top: 3px;
}

.private-chat-panel {
  position: fixed;
  inset: 0;
  max-width: 750px;
  margin: 0 auto;
  background: #fff;
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.private-chat-header {
  height: 56px;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.back-btn {
  border: none;
  background: #f0f5ff;
  color: #1677ff;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  cursor: pointer;
}

.back-btn.small {
  margin-bottom: 0;
  padding: 6px 10px;
}

.private-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f5f7fa;
}

.private-message {
  display: flex;
  gap: 8px;
  max-width: 82%;
}

.private-message.mine {
  flex-direction: row-reverse;
  margin-left: auto;
}

.private-message.mine .chat-bubble {
  background: #1677ff;
  color: #fff;
}

.private-input-bar {
  background: #fff;
  border-top: 1px solid #eee;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.private-input-bar input {
  flex: 1;
}

.private-input-bar button {
  padding: 8px 16px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 6px;
}

/* 帖子详情、媒体放大和全屏 */
.detail-card {
  border-color: #d6e4ff;
}

.detail-content {
  font-size: 16px;
}

.detail-media {
  grid-template-columns: repeat(2, 1fr);
}

.detail-media img, .detail-media video {
  max-height: 260px;
  cursor: zoom-in;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#mediaViewerBody img, #mediaViewerBody video {
  max-width: 96vw;
  max-height: 90vh;
  border-radius: 8px;
}

.media-close {
  position: absolute;
  right: 20px;
  top: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}
