/* 信鸽社区 · 牙夜静（网页版）——沿用官网暖色调 */

/* 顶部导航为 fixed（高 66px），主内容向下让位，避免发布栏/登录卡被遮挡 */
.app-main { max-width: 720px; padding: 88px 16px 60px; }

.card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 18px rgba(74, 32, 32, .06);
}

/* ── 登录区 ── */
.login-gate { text-align: center; padding: 36px 20px; }
.login-gate h3 { margin: 0 0 8px; color: #4a2020; }
.login-gate p { color: #967878; font-size: 14px; margin: 0 0 18px; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: #f5c6d6; color: #a04a6a; font-weight: 700; font-size: 15px; overflow: hidden; }
.user-info { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 14px; }
.mini-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.logout-link { color: #ffd9d9; margin-left: 6px; font-size: 13px; }
.login-link { color: #fff; font-weight: 600; }

/* ── 发帖卡 ── */
.composer-head { display: flex; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #f5e6e6; }
.composer-head textarea {
  flex: 1; border: 1px solid #f0dddd; border-radius: 12px;
  padding: 10px 12px; font-size: 15px; font-family: inherit;
  resize: vertical; min-height: 64px; color: #4a2020; outline: none;
}
.composer-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.char-count { color: #b99a9a; font-size: 12px; }
.composer-actions { display: flex; gap: 8px; align-items: center; }
.composer-voice-hint { color: #c9a9a9; font-size: 12px; margin-top: 8px; }
.composer-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.composer-previews .pv { position: relative; }
.composer-previews img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
.composer-previews .pv .rm { position: absolute; top: -6px; right: -6px; background: #ef5350; color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; line-height: 18px; text-align: center; cursor: pointer; }

/* ── 帖子卡片 ── */
.post { background: #fff; border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 4px 18px rgba(74,32,32,.06); }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head .avatar { width: 38px; height: 38px; }
.post-author { flex: 1; min-width: 0; }
.post-author .name { font-weight: 700; color: #4a2020; font-size: 15px; }
.post-author .time { color: #b99a9a; font-size: 12px; }
.post-del { color: #c9a9a9; font-size: 12px; cursor: pointer; padding: 4px; }
.post-text { margin: 10px 0 0; color: #4a2020; font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.post-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.post-imgs img { width: 31%; border-radius: 8px; cursor: zoom-in; object-fit: cover; aspect-ratio: 1; }
.post-imgs.single img { width: 55%; aspect-ratio: auto; }
.post-voice { margin-top: 10px; }
.post-voice audio { width: 100%; height: 36px; }
.post-actions { display: flex; gap: 18px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f7ecec; }
.post-actions .act { display: inline-flex; align-items: center; gap: 5px; color: #8a6a6a; font-size: 14px; cursor: pointer; user-select: none; }
.post-actions .act.liked { color: #ef5350; font-weight: 700; }

/* ── 评论 ── */
.comment-panel { background: #fff; border-radius: 16px; padding: 14px 18px; margin-bottom: 14px; }
.comment-panel h4 { margin: 0 0 10px; color: #4a2020; font-size: 14px; }
.cmt { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid #faf1f1; }
.cmt .avatar { width: 28px; height: 28px; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-name { font-size: 13px; font-weight: 600; color: #6a4a4a; }
.cmt-time { font-size: 11px; color: #c9a9a9; margin-left: 6px; }
.cmt-text { font-size: 14px; color: #4a2020; margin-top: 2px; line-height: 1.5; word-break: break-word; }
.cmt-del { color: #c9a9a9; font-size: 12px; cursor: pointer; align-self: flex-start; }
.cmt-input-row { display: flex; gap: 8px; margin-top: 10px; }
.cmt-input-row input { flex: 1; border: 1px solid #f0dddd; border-radius: 20px; padding: 8px 14px; font-size: 14px; outline: none; color: #4a2020; }
.cmt-empty { color: #b99a9a; font-size: 13px; text-align: center; padding: 12px 0; }

/* ── 按钮/表单 ── */
.btn-primary { background: #f06292; color: #fff; border: none; border-radius: 22px; padding: 9px 22px; font-size: 15px; cursor: pointer; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-primary.wide { width: 100%; margin-top: 12px; padding: 11px; }
.btn-ghost { background: #fff; color: #f06292; border: 1px solid #f5b8cd; border-radius: 18px; padding: 6px 14px; font-size: 13px; cursor: pointer; display: inline-block; }
.link-btn { background: none; border: none; color: #b99a9a; margin-top: 10px; cursor: pointer; width: 100%; text-align: center; }
.err { color: #e53935; font-size: 13px; margin-top: 8px; }

/* ── 模态 ── */
.modal-mask { position: fixed; inset: 0; background: rgba(60,20,20,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: 92%; max-width: 360px; }
.modal h3 { margin: 0 0 6px; color: #4a2020; }
.modal .muted { color: #967878; font-size: 13px; margin: 0 0 14px; }
.field { margin-bottom: 10px; }
.field input { width: 100%; box-sizing: border-box; border: 1px solid #f0dddd; border-radius: 10px; padding: 10px 12px; font-size: 15px; outline: none; color: #4a2020; }
.field.row { display: flex; gap: 8px; }
.field.row button { flex-shrink: 0; }

/* ── 加载状态 ── */
.feed-status { text-align: center; color: #b99a9a; font-size: 13px; padding: 14px; }
.feed-status .load-more { background: none; border: 1px solid #ecc; border-radius: 16px; color: #b07070; padding: 8px 26px; cursor: pointer; font-size: 14px; }

/* ── 灯箱 ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; z-index: 60; }
.lightbox img { max-width: 94%; max-height: 88%; border-radius: 6px; }
.lb-close { position: absolute; top: 14px; right: 18px; color: #fff; font-size: 28px; cursor: pointer; }
.lb-save { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(255,255,255,.16); padding: 8px 22px; border-radius: 18px; text-decoration: none; font-size: 14px; }
.lb-save:hover { background: rgba(255,255,255,.3); }

/* 移动端导航适配 */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .post-imgs img { width: 48%; }
  .post-imgs.single img { width: 100%; }
}

/* API 域名指示（页面底部小字） */
.api-hint { text-align: center; color: rgba(150, 146, 170, .6); font-size: 11px; padding: 4px 0 16px; }
body.dark .api-hint { color: rgba(180, 176, 200, .5); }

/* ══════════ 夜间模式（18:00–次日 8:00，body.dark，由 dark.js 切换） ══════════ */
body.dark {
  --bg: #05070f;
  --card: rgba(24, 25, 38, .86);
  --ink: #e9e5f2;
  --ink-2: #b8b4c8;
  --ink-3: #8b8aa0;
  color: var(--ink);
  background: #05070f url('bg_star.webp') center/cover fixed no-repeat;
}
/* 官网导航（半透明白 → 半透明深） */
body.dark .nav { background: rgba(14, 15, 26, .78); border-bottom-color: rgba(255,255,255,.08); }
/* 卡片容器 */
body.dark .card,
body.dark .post,
body.dark .comment-panel {
  background: rgba(24, 25, 38, .82);
  box-shadow: 0 8px 28px rgba(0,0,0,.38);
}
/* 主文字 */
body.dark .post-text,
body.dark .post-author .name,
body.dark .comment-panel h4,
body.dark .login-gate h3,
body.dark .modal h3,
body.dark .cmt-name { color: #e9e5f2; }
body.dark .cmt-text { color: #d9d5e6; }
/* 次级文字 */
body.dark .muted,
body.dark .login-gate p,
body.dark .post-author .time,
body.dark .char-count,
body.dark .feed-status,
body.dark .post-del,
body.dark .cmt-time,
body.dark .cmt-del,
body.dark .composer-voice-hint,
body.dark .empty,
body.dark .link-btn { color: #9692aa; }
/* 输入框 */
body.dark .composer-head textarea,
body.dark .field input,
body.dark .cmt-input-row input { background: rgba(8, 9, 18, .55); border-color: rgba(255,255,255,.14); color: #e9e5f2; }
body.dark .composer-head textarea::placeholder,
body.dark input::placeholder { color: #77738e; }
/* 按钮 */
body.dark .btn-ghost { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.18); color: #ffb3cd; }
body.dark .link-btn { color: #9692aa; }
/* 操作行/分隔线 */
body.dark .post-actions { border-top-color: rgba(255,255,255,.08); }
body.dark .post-actions .act { color: #bcb8cc; }
body.dark .post-actions .act.liked { color: #ff8fb3; }
body.dark .cmt { border-top-color: rgba(255,255,255,.06); }
body.dark .composer-head textarea { border-color: rgba(255,255,255,.14); }
body.dark .avatar-fallback { background: #383250; color: #d6c2e8; }
body.dark .modal-mask { background: rgba(0,0,0,.62); }
body.dark .feed-status .load-more { border-color: rgba(255,255,255,.22); color: #c9c5da; background: transparent; }
body.dark .err { color: #ff8a80; }
body.dark .lightbox { background: rgba(0,0,0,.93); }
