/* ═══════════════════════════════════════
   守夜人论坛 — Nightwatcher Forum
   暗色系 + 龙血金点缀
   ═══════════════════════════════════════ */

:root {
  --primary: #0a0e17;
  --gold: #c9a84c;
  --gold-bright: #e8c55a;
  --gold-dim: rgba(201, 168, 76, 0.3);
  --gold-glow: rgba(201, 168, 76, 0.12);
  --text: #e8e0d0;
  --text-dim: #7a7268;
  --bg-dark: #060b14;
  --bg-card: rgba(12, 20, 35, 0.85);
  --bg-card-hover: rgba(18, 28, 48, 0.95);
  --border: rgba(201, 168, 76, 0.12);
  --border-hover: rgba(201, 168, 76, 0.35);
  --danger: #e74c3c;
  --success: #27ae60;
  --info: #3498db;

  --font-serif: 'Noto Serif SC', 'Georgia', serif;
  --font-sans: 'Noto Sans SC', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.3s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-bright); }

img { max-width: 100%; display: block; }

/* ── 星空背景 ── */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold);
  border-radius: 50%;
  animation: starTwinkle var(--dur, 4s) ease-in-out infinite alternate;
  opacity: var(--min-o, 0.2);
}
@keyframes starTwinkle {
  from { opacity: var(--min-o, 0.15); }
  to { opacity: var(--max-o, 0.5); }
}

/* ═══════════════════════════════════════
   导航栏
   ═══════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(6, 11, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
  transition: background var(--transition);
}
.navbar.scrolled {
  background: rgba(6, 11, 20, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 1px;
}
.nav-brand-icon {
  font-size: 1.3rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}
.nav-user-rank {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
}
.nav-user-name {
  color: var(--text-dim);
}
.nav-user-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  transition: all var(--transition);
}
.nav-user-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.nav-auth-link {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: all var(--transition);
}
.nav-auth-link:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.nav-auth-login {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #060b14;
  border: none;
  font-weight: 500;
}
.nav-auth-login:hover {
  color: #060b14;
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}

/* 移动端菜单 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-bar {
  width: 22px;
  height: 2px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: all var(--transition);
}
.menu-toggle.open .menu-bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.open .menu-bar:nth-child(2) { opacity: 0; }
.menu-toggle.open .menu-bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(6, 11, 20, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ═══════════════════════════════════════
   Hero 区
   ═══════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(201, 168, 76, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, #060b14 0%, #0a1020 50%, #060b14 100%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}
.hero-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.3));
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.2);
}
.hero-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
}
.hero-stat {
  text-align: center;
}
.hero-stat-num {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
}
.hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════
   主内容区
   ═══════════════════════════════════════ */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}

/* ── 分类标签栏 ── */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.cat-tab {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.cat-tab:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.cat-tab.active {
  background: var(--gold);
  color: #060b14;
  border-color: var(--gold);
  font-weight: 500;
}

/* ── 发帖按钮 ── */
.new-post-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  color: #060b14;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
  transition: all var(--transition);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.new-post-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(201, 168, 76, 0.4);
}

/* ═══════════════════════════════════════
   帖子卡片
   ═══════════════════════════════════════ */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all var(--transition);
  cursor: pointer;
}
.post-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.8rem;
}
.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.post-meta {
  flex: 1;
  min-width: 0;
}
.post-author {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}
.post-author-rank {
  font-family: var(--font-serif);
  font-weight: 700;
  margin-left: 6px;
}
.post-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.post-category {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.cat-discuss { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.cat情报 { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.cat-talk { background: rgba(39, 174, 96, 0.15); color: #27ae60; }
.cat-lore { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }
.cat-recruit { background: rgba(201, 168, 76, 0.15); color: var(--gold); }

.post-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.post-excerpt {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(201, 168, 76, 0.06);
}
.post-action {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color var(--transition);
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
}
.post-action:hover {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.05);
}
.post-action.active {
  color: var(--gold);
}
.post-action-icon {
  font-size: 0.9rem;
  transition: transform 0.2s;
}
.post-action:active .post-action-icon {
  transform: scale(1.3);
}

/* ═══════════════════════════════════════
   帖子详情
   ═══════════════════════════════════════ */
.post-detail {
  display: none;
}
.post-detail.active {
  display: block;
}
.post-detail-header {
  margin-bottom: 2rem;
}
.post-detail-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.4;
}
.post-detail-body {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.9;
  margin-bottom: 2rem;
  white-space: pre-wrap;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: color var(--transition);
  background: none;
  border: none;
}
.back-btn:hover {
  color: var(--gold);
}

/* ── 评论区 ── */
.comments-section {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.comments-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 1rem;
}
.comment-card {
  background: rgba(12, 20, 35, 0.5);
  border: 1px solid rgba(201, 168, 76, 0.06);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}
.comment-avatar {
  font-size: 1rem;
}
.comment-author {
  font-size: 0.85rem;
  font-weight: 500;
}
.comment-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: auto;
}
.comment-body {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.7;
}

/* ── 评论输入框 ── */
.comment-input-wrap {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}
.comment-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(6, 11, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  transition: border-color var(--transition);
}
.comment-input:focus {
  outline: none;
  border-color: var(--gold-dim);
}
.comment-submit {
  padding: 0.75rem 1.2rem;
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  color: #060b14;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.comment-submit:hover {
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}

/* ═══════════════════════════════════════
   发帖弹窗
   ═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.modal h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* ── 表单 ── */
.form-group {
  margin-bottom: 1.2rem;
}
.form-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(6, 11, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}
.form-select {
  cursor: pointer;
}
.form-select option {
  background: #0a1020;
  color: var(--text);
}
.form-error {
  font-size: 0.72rem;
  color: var(--danger);
  margin-top: 0.3rem;
  min-height: 1rem;
}
.form-submit {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: var(--radius);
  color: #060b14;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition);
}
.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(201, 168, 76, 0.3);
}
.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════
   Toast 通知
   ═══════════════════════════════════════ */
.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 10px 24px;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: 0.85rem;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════
   页脚
   ═══════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.78rem;
}
.footer a { color: var(--gold); }
.footer-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════
   滚动条
   ═══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ═══════════════════════════════════════
   动画
   ═══════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.4s ease;
}

/* ═══════════════════════════════════════
   空状态
   ═══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state-text {
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════
   移动端适配
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
  .hero { padding: 6rem 1.5rem 3rem; min-height: 35vh; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat-num { font-size: 1.4rem; }
  .main-content { padding: 1.5rem 1rem 5rem; }
  .post-card { padding: 1.2rem; }
  .post-title { font-size: 1rem; }
  .modal { padding: 1.5rem; }
  .new-post-btn { bottom: 1.5rem; right: 1.5rem; width: 50px; height: 50px; font-size: 1.3rem; }
}

/* ═══════════════════════════════════════
   管理员页面
   ═══════════════════════════════════════ */
.admin-section {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.admin-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.admin-card h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.admin-card .sub {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 1.5rem;
}
.rank-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(6, 11, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}
.rank-preview-letter {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
}
.rank-preview-info {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.rank-preview-name {
  color: var(--gold);
  font-weight: 500;
}
.result {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  display: none;
}
.result.success {
  display: block;
  background: rgba(39, 174, 96, 0.1);
  border: 1px solid rgba(39, 174, 96, 0.3);
  color: var(--success);
}
.result.error {
  display: block;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--danger);
}

/* ═══════════════════════════════════════
   搜索栏
   ═══════════════════════════════════════ */
.search-bar {
  margin-bottom: 1rem;
}
.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237a7268' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.search-input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}
.search-input::placeholder {
  color: var(--text-dim);
}

/* ═══════════════════════════════════════
   工具栏（分类 + 排序）
   ═══════════════════════════════════════ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.category-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.sort-bar {
  display: flex;
  gap: 0.3rem;
}
.sort-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.sort-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.sort-btn.active {
  background: var(--gold);
  color: #060b14;
  border-color: var(--gold);
  font-weight: 500;
}

/* ═══════════════════════════════════════
   双栏布局（帖子 + 侧边栏）
   ═══════════════════════════════════════ */
.main-content.with-sidebar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  max-width: 1100px;
}
@media (max-width: 900px) {
  .main-content.with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
}

/* ═══════════════════════════════════════
   侧边栏
   ═══════════════════════════════════════ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}
.sidebar-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-about p {
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* ── 热门话题 ── */
.hot-topic-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.05);
  transition: background var(--transition);
}
.hot-topic-item:last-child {
  border-bottom: none;
}
.hot-topic-item:hover {
  background: rgba(201, 168, 76, 0.03);
  border-radius: 6px;
}
.hot-topic-rank {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 20px;
  text-align: center;
}
.hot-topic-info {
  flex: 1;
  min-width: 0;
}
.hot-topic-title {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-topic-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* ── 在线用户 ── */
.online-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0;
  font-size: 0.82rem;
}
.online-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
}
.online-avatar {
  font-size: 0.9rem;
}
.online-name {
  color: var(--text);
  flex: 1;
}
.online-rank {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════
   帖子卡片增强
   ═══════════════════════════════════════ */
.post-pinned {
  border-color: rgba(201, 168, 76, 0.25);
  background: rgba(201, 168, 76, 0.03);
}
.post-pin-badge {
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}
.post-views {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  font-size: 0.78rem;
}
.post-detail-actions {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ═══════════════════════════════════════
   新增分类颜色
   ═══════════════════════════════════════ */
.cat-academic { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }
.cat-help { background: rgba(241, 196, 15, 0.15); color: #f1c40f; }

/* ═══════════════════════════════════════
   移动端适配
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .category-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .cat-tab {
    flex-shrink: 0;
  }
  .sort-bar {
    justify-content: center;
  }
  .sidebar-card {
    padding: 1rem;
  }
}
