*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0a0c11;
  --card: #14171f;
  --card-2: #1a1e28;
  --border: #242936;
  --border-2: #2e3444;
  --text: #e9ebf2;
  --dim: #98a0b5;
  --faint: #666e82;
  --accent: #6366f1;
  --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --danger: #ef4444;
  --success: #22c55e;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -10%, rgba(99,102,241,.16), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; }

/* ============ 顶栏 ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10,12,17,.75);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 700; font-size: 17px; letter-spacing: .3px;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.nav-links { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.nav-link {
  color: var(--dim); text-decoration: none;
  padding: 7px 14px; border-radius: 9px;
  border: 1px solid transparent; background: none;
  cursor: pointer; font-family: inherit; font-size: 14px;
  transition: .18s;
}
.nav-link:hover { color: var(--text); background: var(--card-2); }
.nav-link.primary {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
}
.nav-link.primary:hover { filter: brightness(1.1); }
.nav-user {
  color: var(--text); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.badge {
  font-style: normal; font-size: 11px; padding: 2px 7px;
  border-radius: 6px;
  background: rgba(99,102,241,.15); color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.3);
}

/* ============ 布局 ============ */
.app { max-width: 960px; margin: 0 auto; padding: 32px 20px 80px; }

.hero { text-align: center; padding: 40px 0 32px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 44px); margin: 0 0 10px;
  letter-spacing: -.5px;
  background: linear-gradient(135deg, #fff 20%, #a5b4fc 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--dim); margin: 0; font-size: 15px; letter-spacing: 2px; }

/* ============ 表单控件 ============ */
.input {
  width: 100%; padding: 12px 15px;
  border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 14.5px;
  outline: none; transition: .18s;
}
.input::placeholder { color: var(--faint); }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.search { flex: 1; }
.textarea { resize: vertical; line-height: 1.7; }

.label {
  display: block; font-size: 13px; color: var(--dim);
  margin: 14px 0 7px; font-weight: 500;
}
.form-error {
  color: #fca5a5; font-size: 13px;
  min-height: 18px; margin-top: 10px;
}

/* ============ 按钮 ============ */
.btn {
  padding: 12px 20px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--card-2); color: var(--text);
  font-family: inherit; font-size: 14.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: .18s;
}
.btn:hover:not(:disabled) { background: #232838; border-color: #3a4152; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent-grad); border: none; color: #fff;
  box-shadow: 0 6px 20px rgba(99,102,241,.35);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 8px 26px rgba(99,102,241,.45);
}
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger {
  color: #fca5a5; border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.08);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.16); }

/* ============ 工具栏 ============ */
.toolbar { display: flex; gap: 12px; margin-bottom: 22px; }

/* ============ 帖子卡片 ============ */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 22px;
  transition: .2s; position: relative; overflow: hidden;
}
.post-card:hover {
  border-color: var(--border-2); background: var(--card-2);
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.post-card.pinned { border-color: rgba(99,102,241,.4); }
.post-card.pinned::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent-grad);
}
.post-card-head {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.post-title {
  font-size: 17px; font-weight: 650; color: var(--text);
  text-decoration: none; transition: .16s;
}
.post-title:hover { color: #a5b4fc; }
.post-excerpt {
  margin: 0 0 14px; color: var(--dim);
  font-size: 14px; line-height: 1.7;
}
.post-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--faint); flex-wrap: wrap;
}
.post-meta .spacer { flex: 1; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-grad); color: #fff;
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: none;
}
.dot { opacity: .5; }
.tag {
  font-size: 11.5px; padding: 2px 8px;
  border-radius: 6px; font-weight: 600;
}
.tag-pin {
  background: rgba(99,102,241,.15); color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.3);
}
.tag-lock {
  background: rgba(245,158,11,.12); color: #fcd34d;
  border: 1px solid rgba(245,158,11,.3);
}

/* ============ 官方身份标签（站长 / 管理员） ============ */
.tag-owner,
.tag-admin {
  display: inline-block; vertical-align: middle;
  font-size: 11px; line-height: 1.2; font-weight: 600;
  padding: 3px 7px; margin-left: 4px;
  border-radius: 999px; white-space: nowrap;
}
.tag-owner {
  color: #ffd98a;
  background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(245,158,11,.08));
  border: 1px solid rgba(245,158,11,.55);
  box-shadow: 0 0 8px rgba(245,158,11,.2);
}
.tag-admin {
  color: #93c5fd;
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(59,130,246,.08));
  border: 1px solid rgba(59,130,246,.55);
  box-shadow: 0 0 8px rgba(59,130,246,.2);
}

/* ============ 分页 ============ */
.pager {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; margin-top: 28px; flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 9px; background: var(--card);
  border: 1px solid var(--border); color: var(--dim);
  font-family: inherit; font-size: 13.5px;
  cursor: pointer; transition: .16s;
}
.page-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border-2); }
.page-btn.active { background: var(--accent-grad); border: none; color: #fff; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-gap { color: var(--faint); padding: 0 2px; }

/* ============ 帖子详情 ============ */
.back-link {
  color: var(--dim); text-decoration: none;
  font-size: 14px; display: inline-block;
  margin-bottom: 18px; transition: .16s;
}
.back-link:hover { color: var(--text); }
.post-detail {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 28px 30px;
}
.post-detail-head {
  padding-bottom: 18px; border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.post-detail h1 { font-size: 26px; margin: 0 0 14px; line-height: 1.4; }
.post-content {
  font-size: 15.5px; line-height: 1.85; color: #d3d7e3;
  white-space: pre-wrap; word-break: break-word;
}
.post-actions {
  display: flex; gap: 10px; margin-top: 24px;
  padding-top: 20px; border-top: 1px solid var(--border);
}
.post-actions .spacer { flex: 1; }

/* ============ 点赞按钮 ============ */
.like-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: transparent; color: var(--faint);
  font-family: inherit; font-size: 13px; line-height: 1.4;
  cursor: pointer; white-space: nowrap; transition: .18s;
}
.like-btn:hover:not(:disabled) { border-color: rgba(248,113,113,.45); color: #fca5a5; }
.like-btn:disabled { opacity: .5; cursor: not-allowed; }
.like-btn .like-icon { filter: grayscale(1); opacity: .55; transition: .18s; }
.like-btn.liked {
  color: #fca5a5;
  border-color: rgba(248,113,113,.45);
  background: rgba(248,113,113,.08);
}
.like-btn.liked .like-icon { filter: none; opacity: 1; }
.like-btn-big { padding: 9px 16px; font-size: 14px; }

/* ============ 关注按钮 ============ */
.follow-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 12px; border-radius: 999px;
  border: 1px solid rgba(99,102,241,.5);
  background: rgba(99,102,241,.12); color: #a5b4fc;
  font-family: inherit; font-size: 12px; line-height: 1.6;
  cursor: pointer; transition: .18s; white-space: nowrap;
}
.follow-btn:hover:not(:disabled) { background: rgba(99,102,241,.25); }
.follow-btn.following {
  background: transparent; border-color: var(--border-2); color: var(--faint);
}
.follow-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 用户链接（点头像/名字进主页） ============ */
.user-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: inherit; text-decoration: none;
}
.user-link:hover .user-name,
.user-link:hover strong { text-decoration: underline; }

/* 头像图片 */
img.avatar { object-fit: cover; }

/* 上传头像按钮 */
.upload-btn { display: inline-block; margin-bottom: 10px; cursor: pointer; }

/* ============ 个人主页 ============ */
.profile-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 26px 28px; margin: 18px 0 26px;
}
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-info { min-width: 160px; }
.profile-name { margin: 0 0 6px; font-size: 22px; }
.profile-sub { margin: 0; color: var(--faint); font-size: 13px; }
.profile-stats {
  display: flex; gap: 34px; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid var(--border);
}
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-item b { font-size: 18px; color: var(--text); }
.stat-item span { font-size: 12.5px; color: var(--faint); }
.stat-link { cursor: pointer; }
.stat-link:hover b, .stat-link:hover span { color: #a5b4fc; }
.profile-posts h3 { font-size: 17px; margin: 0 0 14px; }

/* 粉丝/关注 用户列表弹窗 */
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: var(--r-sm);
  color: var(--text); text-decoration: none;
}
.user-row:hover { background: var(--card-2); }
.user-row-name { font-size: 14px; }
.notice {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.28);
  color: #fcd34d; padding: 12px 16px;
  border-radius: 10px; font-size: 14px; margin-top: 20px;
}

/* ============ 评论 ============ */
.comments { margin-top: 32px; }
.comments h3 { font-size: 17px; margin: 0 0 16px; }
.comments .count { color: var(--faint); font-weight: 400; font-size: 14px; }
.comment-editor {
  display: flex; flex-direction: column;
  gap: 10px; margin-bottom: 24px;
}
.comment-editor .btn { align-self: flex-end; }
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 16px 18px;
}
.comment-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--faint); margin-bottom: 8px;
}
.comment-head strong { color: var(--text); font-weight: 600; font-size: 13.5px; }
.comment-body {
  font-size: 14.5px; line-height: 1.75; color: #cdd2e0;
  white-space: pre-wrap; word-break: break-word;
}
.comment-del {
  margin-left: auto; background: none; border: none;
  color: var(--faint); cursor: pointer; font-size: 12.5px;
  padding: 2px 6px; border-radius: 6px; transition: .16s;
}
.comment-del:hover { color: #fca5a5; background: rgba(239,68,68,.1); }

/* ============ 登录 / 注册 ============ */
.auth-wrap { display: grid; place-items: center; min-height: 60vh; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 34px 30px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 6px; font-size: 24px; }
.auth-card .sub { margin: 0 0 24px; color: var(--dim); font-size: 14px; }
.auth-foot {
  text-align: center; color: var(--dim);
  font-size: 14px; margin: 20px 0 0;
}
.auth-foot a { color: #a5b4fc; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.advanced {
  margin-top: 18px; border-top: 1px solid var(--border);
  padding-top: 4px;
}
.advanced summary {
  cursor: pointer; color: var(--faint); font-size: 13px;
  padding: 10px 0; list-style: none; user-select: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: '▸ '; }
.advanced[open] summary::before { content: '▾ '; }

/* ============ 管理后台 ============ */
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 26px;
}
.admin-head h2 { margin: 0; font-size: 24px; }
.stats { display: flex; gap: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 18px;
  text-align: center; min-width: 78px;
}
.stat b {
  display: block; font-size: 20px;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-size: 12px; color: var(--faint); }
.tabs {
  display: flex; gap: 6px;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.tab {
  background: none; border: none; color: var(--dim);
  font-family: inherit; font-size: 14.5px;
  padding: 10px 16px; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: .16s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #a5b4fc; border-bottom-color: var(--accent); }
.hidden { display: none !important; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; color: var(--faint); font-weight: 500;
  font-size: 12.5px; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: .5px;
}
.table td {
  padding: 13px 12px; border-bottom: 1px solid var(--border);
  color: #cdd2e0;
}
.table tr:hover td { background: rgba(255,255,255,.015); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* 站长保护：不可操作的灰色提示 */
.row-locked { color: var(--faint); font-size: 12px; line-height: 2; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,7,11,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .18s ease;
}
.modal {
  width: 100%; max-width: 560px;
  background: var(--card); border: 1px solid var(--border-2);
  border-radius: 18px; box-shadow: var(--shadow);
  animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
  overflow: hidden;
}
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97) } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body {
  padding: 18px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-foot {
  padding: 0 24px 22px;
  display: flex; justify-content: flex-end; gap: 10px;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; border: none;
  background: transparent; color: var(--dim);
  font-size: 22px; line-height: 1;
  cursor: pointer; transition: .16s;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 40px;
  transform: translate(-50%, 20px);
  background: var(--card-2); border: 1px solid var(--border-2);
  color: var(--text); padding: 12px 22px;
  border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: .28s; z-index: 200;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(239,68,68,.5); color: #fca5a5; }
.toast.success { border-color: rgba(34,197,94,.5); color: #86efac; }

/* ============ 状态 ============ */
.loading, .empty {
  text-align: center; color: var(--faint);
  padding: 60px 20px; font-size: 14.5px;
}

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .app { padding: 20px 16px 60px; }
  .nav-inner { padding: 0 16px; height: 56px; }
  .brand-text { display: none; }
  .hero { padding: 24px 0 20px; }
  .hero p { letter-spacing: 1px; font-size: 13.5px; }
  .toolbar { flex-direction: column; }
  .post-card { padding: 16px 18px; }
  .post-detail { padding: 20px; }
  .post-detail h1 { font-size: 21px; }
  .auth-card { padding: 26px 22px; }
  .admin-head { flex-direction: column; align-items: flex-start; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 10px 8px; }
  .modal-body { padding: 14px 18px; }
  .modal-head { padding: 16px 18px 0; }
  .modal-foot { padding: 0 18px 18px; }
}
/* ============ 设置页 ============ */
.settings-page { max-width: 620px; margin: 0 auto; }
.settings-page h2 { margin: 0 0 24px; font-size: 24px; }
.settings-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px 24px; margin-bottom: 16px;
}
.settings-section h3 {
  margin: 0 0 8px; font-size: 16px; color: var(--text);
}
.hint { color: var(--faint); font-size: 13px; margin: 4px 0 12px; }

.avatar-preview { display: flex; justify-content: center; padding: 12px 0 18px; }
.avatar-lg {
  width: 88px !important; height: 88px !important;
  font-size: 42px !important;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 8px 28px rgba(99,102,241,.35);
  color: #fff; font-weight: 700;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
}
.avatar-choice {
  aspect-ratio: 1;
  font-size: 22px;
  background: var(--card-2);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer; transition: .16s;
}
.avatar-choice:hover { transform: translateY(-2px); background: #232838; }
.avatar-choice.active {
  border-color: var(--accent);
  background: rgba(99,102,241,.15);
}

.color-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.color-choice {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: .16s;
}
.color-choice:hover { transform: scale(1.1); }
.color-choice.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.settings-actions { margin-top: 8px; }

/* ============ 私信 ============ */
.messages-head { position: relative; margin-bottom: 20px; }
.messages-head h2 { margin: 0 0 14px; font-size: 24px; }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: 12px; margin-top: 8px; padding: 6px;
  z-index: 10; max-height: 300px; overflow-y: auto;
  box-shadow: var(--shadow);
}
.search-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 14.5px;
  transition: .16s;
}
.search-user:hover { background: rgba(99,102,241,.12); }
.search-empty {
  padding: 14px; color: var(--faint); font-size: 13.5px; text-align: center;
}

.conv-list {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.conv-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border);
  transition: .16s; position: relative;
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: var(--card-2); }
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; margin-bottom: 3px; }
.conv-name { font-weight: 600; color: var(--text); font-size: 14.5px; }
.conv-time { color: var(--faint); font-size: 12px; }
.conv-preview {
  color: var(--dim); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-badge {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: var(--accent-grad); color: #fff;
  font-size: 11px; min-width: 20px; height: 20px;
  border-radius: 10px; display: grid; place-items: center;
  padding: 0 6px; font-weight: 700;
}

/* ============ 对话 ============ */
.chat-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); display: flex; flex-direction: column;
  height: 70vh; min-height: 500px; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.chat-name { font-weight: 600; font-size: 15px; }
.chat-body {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-msg { display: flex; flex-direction: column; max-width: 72%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 14.5px; line-height: 1.6;
  word-break: break-word; white-space: pre-wrap;
}
.chat-msg.mine .chat-bubble {
  background: var(--accent-grad); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.theirs .chat-bubble {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--border-2);
  border-bottom-left-radius: 4px;
}
.chat-time {
  font-size: 11.5px; color: var(--faint);
  margin-top: 4px; padding: 0 4px;
}
.chat-input {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid var(--border); align-items: flex-end;
}
.chat-input .textarea { flex: 1; min-height: 44px; max-height: 120px; }

/* 导航栏：消息图标 */
#msgLink { font-size: 16px; padding: 6px 10px; }
.nav-user-link { text-decoration: none; }
/* ============ Firefox 专属主题面板 ============ */
.ff-theme-panel {
  margin-top: 22px;
  border: 1px solid #ff6611;
  border-radius: 12px;
  padding: 14px 18px;
  background: rgba(255,102,17,.05);
}
.ff-theme-panel summary {
  cursor: pointer;
  color: #ff6611;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  user-select: none;
}
.ff-theme-panel summary::-webkit-details-marker { display: none; }
.ff-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.ff-theme-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: .16s;
}
.ff-theme-item:hover { background: var(--card-2); }
.ff-theme-item.active {
  border-color: var(--accent);
  background: rgba(99,102,241,.1);
}
.ff-theme-dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
}
.ff-theme-hint {
  color: var(--faint); font-size: 12px; margin: 12px 0 0;
}

/* ============ 烟花特效 ============ */
#ff-fireworks {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  animation: ff-fade-in .3s ease;
}
#ff-fireworks.closing {
  animation: ff-fade-out .5s ease forwards;
}
#ff-fireworks-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.ff-fireworks-text {
  position: absolute;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ff6611, #ffd93d, #ff6b9d, #a78bfa);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255,102,17,.6);
  animation: ff-text-bounce 1s ease, ff-text-flow 3s linear infinite;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
@keyframes ff-fade-in { from { opacity: 0 } }
@keyframes ff-fade-out { to { opacity: 0 } }
@keyframes ff-text-bounce {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes ff-text-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}/* ============ 公告条 ============ */
.notice-bar {
  max-width: 960px;
  margin: 18px auto 0;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;          /* 公告区限高，避免长公告占满屏幕 */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.notice-item {
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.06));
  border: 1px solid rgba(99,102,241,.35);
  border-left: 4px solid #6366f1;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13.5px;
}
.notice-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.notice-spacer { flex: 1; }
.notice-tag {
  display: inline-block;
  background: var(--accent-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 1px;
  flex: none;
}
.notice-toggle {
  flex: none;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(99,102,241,.45);
  background: rgba(99,102,241,.12);
  color: #a5b4fc;
  cursor: pointer;
  transition: .18s;
}
.notice-toggle:hover { background: rgba(99,102,241,.25); }
.notice-content {
  color: var(--text);
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}
.notice-content.collapsed {
  max-height: 3.2em;          /* 默认只显示约两行 */
  overflow: hidden;
}
.notice-meta {
  color: var(--faint);
  font-size: 12px;
  flex: none;
}

@media (max-width: 640px) {
  .notice-bar { padding: 0 16px; margin-top: 14px; max-height: 160px; }
  .notice-item { padding: 10px 14px; font-size: 12.5px; }
}

/* ============ 三栏布局（左个人信息 / 中内容 / 右金币） ============ */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 20px;
  max-width: 1280px;
  margin: 18px auto 0;
  padding: 0 20px;
  align-items: start;
}
.layout .app {
  max-width: none;
  margin: 0;
  padding: 14px 0 80px;
}
.side-panel { position: sticky; top: 84px; }
.side-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.side-title { margin: 0 0 12px; font-size: 14px; color: var(--dim); }
.side-hint { color: var(--faint); font-size: 12px; margin: 6px 0; }
.side-user { margin-bottom: 12px; }
.side-name { font-size: 14px; }
.side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.side-stat { display: flex; flex-direction: column; font-size: 12px; color: var(--faint); }
.side-stat b { font-size: 16px; color: var(--text); }
.side-btn { width: 100%; display: block; text-align: center; margin-top: 8px; }
.coin-count {
  font-size: 30px;
  font-weight: 700;
  color: #fbbf24;
  text-align: center;
  padding: 6px 0;
}

/* ============ 私信管理 ============ */
.cell-ellipsis {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-thread { max-height: 360px; overflow-y: auto; }
.admin-msg { border-bottom: 1px solid var(--border); padding: 8px 0; }
.admin-msg:last-child { border-bottom: none; }
.admin-msg-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--faint); margin-bottom: 4px;
  flex-wrap: wrap;
}
.admin-msg-head b { color: var(--text); }
.admin-msg-head .btn { margin-left: auto; }
.admin-msg-time { font-size: 12px; }
.admin-msg-body {
  color: var(--text); font-size: 13.5px;
  white-space: pre-wrap; word-break: break-word;
}
.admin-interject {
  display: flex; gap: 10px; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.admin-interject .input { flex: 1; }

/* ============ 提拔候选人 ============ */
.candidate-list { display: flex; flex-direction: column; gap: 10px; }
.candidate-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 16px;
}
.candidate-info { flex: 1; min-width: 0; }
.candidate-name { font-size: 14.5px; color: var(--text); }
.candidate-meta { font-size: 12.5px; color: var(--faint); margin-top: 2px; }

/* 历史违规警示色 */
.side-warn { color: #fca5a5; }

/* ============ 发图与待审核 ============ */
.tag-pending {
  background: rgba(245,158,11,.15);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,.4);
}
.image-tools {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
}
/* Turnstile 人机验证 */
.turnstile-wrap { display: flex; justify-content: center; margin: 12px 0; }
.image-err { color: #fca5a5; font-size: 12px; }
.image-warn { color: #fca5a5; font-size: 12.5px; margin: 8px 0 0; }
.post-image {
  max-width: 100%;
  border-radius: 10px;
  margin: 8px 0;
  display: block;
}

/* 后台用户表格：用户名可点击进主页 */
.table-user-link { color: var(--text); text-decoration: none; }
.table-user-link:hover { color: #a5b4fc; text-decoration: underline; }

/* 侧栏用户搜索 */
.side-search-results {
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 4px;
  max-height: 220px; overflow-y: auto;
}
.side-search-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 13px;
}
.side-search-item:hover { background: var(--card-2); }

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-panel { display: none; }
  .layout .app { padding: 0 0 80px; }
}