/* 社区模块样式：聊天室、提醒铃铛与列表、点赞、搜索。只用 base.css 的变量和组件。 */

/* ---------- 导航条铃铛 ---------- */
.bell { position: relative; display: flex; align-items: center; justify-content: center; height: var(--nav-h); min-width: 44px; padding: 0 10px; color: #dfe5ea; }
.bell:hover { background: var(--gunmetal-2); color: #fff; text-decoration: none; }
.bell:focus-visible { box-shadow: inset 0 0 0 2px #fff; border-radius: 0; }
.bell-badge {
  position: absolute; top: 6px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--taxiway); color: var(--gunmetal);
  font-size: 11px; line-height: 18px; font-weight: 700; text-align: center;
}

/* ---------- 提醒列表 ---------- */
.alert-row { align-items: flex-start; }
.alert-row.is-unread { box-shadow: inset 3px 0 0 var(--taxiway); background: #fffdf6; }
.alert-text { overflow-wrap: anywhere; }
.alert-readall { margin: 0; }
.alert-readall .btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; }
.alert-readall .btn:hover { background: rgba(255, 255, 255, .22); }
.alert-readall .btn[disabled] { opacity: .5; }

/* ---------- 聊天室 ---------- */
.chat-log {
  list-style: none; margin: 0; padding: 6px 0; height: 340px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
}
.chat[data-mode="page"] .chat-log { height: min(60vh, 560px); min-height: 320px; }
.chat-log:focus-visible { box-shadow: inset var(--focus); border-radius: 0; }
.chat-msg { display: flex; gap: 10px; padding: 5px 14px; align-items: flex-start; }
.chat-msg:hover { background: #fafbfc; }
.chat-msg-main { min-width: 0; flex: 1; }
.chat-msg-head { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-s); line-height: 1.4; }
.chat-msg-head time { color: var(--ink-3); font-size: var(--fs-xs); }
.chat-msg-body { margin: 1px 0 0; overflow-wrap: anywhere; line-height: 1.5; }
.chat-msg .avatar { margin-top: 2px; }
.chat-del { margin: 0 0 0 auto; }
.chat-del-btn { background: none; border: 0; padding: 2px 6px; color: var(--ink-3); font-size: var(--fs-xs); cursor: pointer; border-radius: var(--r-btn); }
.chat-del-btn:hover { color: var(--danger); background: #fbeceb; }
.chat-empty, .chat-note { margin: 0; padding: 14px; color: var(--ink-3); text-align: center; }
.chat-empty[hidden] { display: none; }
.chat-note { border-top: 1px solid var(--line-2); background: var(--surface-2); }
.chat-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.chat-form .chat-input { flex: 1; min-width: 0; height: 36px; }
.chat-form .btn { height: 36px; }
.chat-error { margin: 0; padding: 6px 14px 10px; background: var(--surface-2); }
.chat-more-row { padding: 8px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); text-align: center; font-size: var(--fs-s); }
.chat-more.is-loading { color: var(--ink-3); pointer-events: none; }
.chat-history-note { color: var(--ink-2); font-size: var(--fs-s); }
.admin-chat-body { display: block; overflow-wrap: anywhere; }

/* ---------- 点赞 ---------- */
.likebar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0 0; font-size: var(--fs-s); color: var(--ink-2); }
.like-form { margin: 0; }
.like-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--r-btn); background: var(--surface); color: var(--ink-2); font-size: var(--fs-s); cursor: pointer;
}
.like-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.like-btn[aria-pressed="true"] { background: var(--roundel); border-color: var(--roundel); color: #fff; }
.like-btn[aria-pressed="true"]:hover { background: var(--roundel-dark); }
.like-btn[disabled] { opacity: .6; cursor: progress; }
.like-summary { overflow-wrap: anywhere; }

/* ---------- 搜索 ---------- */
.search-form { display: flex; gap: 8px; }
.search-form .input { flex: 1; min-width: 0; height: 38px; }
.search-form .btn { height: 38px; }
.search-tabs { display: flex; gap: 4px; margin-top: 12px; border-bottom: 1px solid var(--line-2); }
.search-tabs a { padding: 6px 14px; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.search-tabs a:hover { color: var(--ink); text-decoration: none; background: var(--surface-2); }
.search-tabs a[aria-current] { color: var(--ink); font-weight: 600; border-bottom-color: var(--roundel); }
.search-hit { align-items: flex-start; padding: 12px 14px; }
.search-title { font-size: var(--fs); font-weight: 600; }
.search-snippet { margin: 4px 0; color: var(--ink-2); font-size: var(--fs-s); overflow-wrap: anywhere; }
.search-snippet mark, .search-title mark { background: #fbe9b0; color: inherit; padding: 0 1px; border-radius: 2px; }
.search-none { font-size: var(--fs-m); }
.search-tips { color: var(--ink-2); padding-left: 1.2em; margin: 0; }

@media (max-width: 767px) {
  .chat-log { height: 300px; }
  .chat[data-mode="page"] .chat-log { height: 56vh; }
  .chat-msg { padding: 5px 12px; }
  .chat-form { padding: 8px 12px; }
  /* 手机上输入框字号不小于 16px，避免 iOS 聚焦时页面被放大 */
  .chat-form .chat-input, .search-form .input { font-size: 16px; }
  .chat-del-btn { padding: 6px 8px; }
  .search-tabs a { padding: 8px 10px; }
}
