/* ============ 刀片服务器论坛 全局样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0e1020;
  --card: rgba(255,255,255,0.07);
  --card-border: rgba(255,255,255,0.12);
  --txt: #e8eaf2;
  --txt-dim: #9aa0b5;
  --accent: #5b8cff;
  --accent-soft: rgba(91,140,255,0.18);
  --danger: #ff5f6d;
  --gold: #ffd760;
  --radius: 16px;
  --blur: 18px;
}
body {
  background-color: #0e1020;
  background-attachment: fixed;
  color: var(--txt);
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  transition: background-image 0.8s ease;
}
a { color: var(--txt); text-decoration: none; }
.page { max-width: 720px; margin: 0 auto; padding: 16px; }

/* 顶部导航 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  background: var(--card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.brand { font-weight: 700; font-size: 16px; color: var(--gold); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  font-size: 13px; padding: 6px 11px; border-radius: 9px;
  color: var(--txt-dim); transition: all .25s;
}
.nav a:hover { background: var(--card); color: var(--txt); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* 工具栏 */
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.toolbar input {
  flex: 1; min-width: 160px; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--card-border); background: var(--card); color: var(--txt);
  font-size: 14px; outline: none;
}
.toolbar input::placeholder { color: var(--txt-dim); }

.btn {
  padding: 10px 18px; border-radius: 11px; border: 1px solid var(--card-border);
  background: var(--card); color: var(--txt); font-size: 14px; cursor: pointer;
  transition: all .25s;
}
.btn:hover { background: rgba(255,255,255,0.14); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #4a7bf0; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12px; }

/* 实时统计条 */
.stats-bar {
  font-size: 13px; color: var(--txt-dim);
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 14px;
}
.stats-bar span { color: var(--gold); font-weight: 600; }

/* 帖子列表 */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-card {
  background: var(--card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; transition: all .25s;
}
.post-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.25); }
.post-card.pinned { border-color: rgba(255,215,96,0.45); }
.pin-tag {
  display: inline-block; font-size: 11px; color: #7a5a00;
  background: var(--gold); border-radius: 6px; padding: 1px 7px; margin-left: 6px;
  vertical-align: middle;
}
.post-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.post-preview { font-size: 14px; color: var(--txt-dim); line-height: 1.6; margin-bottom: 10px; }
.post-meta {
  display: flex; gap: 12px; font-size: 12px; color: var(--txt-dim);
  align-items: center; flex-wrap: wrap;
}
.post-meta .author { color: var(--accent); }
.post-actions { display: inline-flex; gap: 10px; margin-left: auto; }
.post-actions button { background: none; border: none; color: var(--txt-dim); font-size: 12px; cursor: pointer; }
.post-actions button:hover { color: var(--txt); }
.post-actions button.liked { color: var(--danger); }
.loading { text-align: center; color: var(--txt-dim); padding: 30px 0; font-size: 14px; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination a {
  padding: 6px 12px; border-radius: 8px; font-size: 13px;
  background: var(--card); border: 1px solid var(--card-border); color: var(--txt-dim);
}
.pagination a.active { background: var(--accent); color: #fff; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: rgba(20,22,40,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border); border-radius: 18px;
  padding: 22px; width: 100%; max-width: 420px;
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; text-align: center; }
.modal input, .modal textarea {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--card-border); background: rgba(255,255,255,0.08);
  color: var(--txt); font-size: 14px; margin-bottom: 10px; outline: none;
  font-family: inherit;
}
.modal textarea { min-height: 90px; resize: vertical; }
.modal .tip { font-size: 12px; color: var(--txt-dim); margin-bottom: 12px; text-align: center; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(20,22,40,0.95); color: var(--txt); border: 1px solid var(--card-border);
  padding: 11px 18px; border-radius: 11px; font-size: 13px; z-index: 999;
  opacity: 0; transition: all .3s; pointer-events: none;
}
.toast.show { opacity: 1; bottom: 40px; }
.toast.err { border-color: var(--danger); color: var(--danger); }

/* 帖子详情 */
.post-detail .post-card { cursor: default; }
.post-detail .post-card:hover { transform: none; }
.detail-content { font-size: 15px; line-height: 1.8; margin-bottom: 12px; white-space: pre-wrap; word-break: break-word; }
.detail-time { font-size: 12px; color: var(--txt-dim); }
.delete-btn { margin-left: auto; }

/* 评论区 */
.comment-section {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 16px 18px; margin-top: 14px;
}
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment-item {
  padding: 10px 12px; background: rgba(255,255,255,0.05); border-radius: 10px;
  font-size: 13px;
}
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment-head .author { color: var(--accent); font-weight: 600; }
.comment-head .time { color: var(--txt-dim); font-size: 11px; }
.comment-head button { margin-left: auto; background: none; border: none; color: var(--txt-dim); font-size: 11px; cursor: pointer; }
.comment-head button:hover { color: var(--danger); }
.comment-input { display: flex; gap: 8px; }
.comment-input input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--card-border); background: rgba(255,255,255,0.06); color: var(--txt); font-size: 13px; outline: none; }

/* 个人中心 */
.profile-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px; }
.profile-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--card-border); }
.profile-row:last-child { border-bottom: none; }
.profile-row .label { color: var(--txt-dim); font-size: 14px; }
.profile-row .value { font-size: 14px; }
.rename-box { display: flex; gap: 8px; margin-top: 10px; }
.rename-box input { flex: 1; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--card-border); background: rgba(255,255,255,0.07); color: var(--txt); font-size: 13px; outline: none; }
.mini-title { font-size: 14px; font-weight: 600; margin: 18px 0 10px; }
.profile-posts { display: flex; flex-direction: column; gap: 8px; }
.profile-post {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 11px 14px; cursor: pointer; font-size: 13px;
}
.profile-post:hover { border-color: rgba(255,255,255,0.25); }
.profile-post .pt { font-weight: 600; margin-bottom: 4px; }
.profile-post .pm { font-size: 11px; color: var(--txt-dim); }
.empty-tip { color: var(--txt-dim); font-size: 13px; padding: 16px 0; text-align: center; }

/* 管理后台 */
.admin-box { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px; }
.user-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--card-border);
}
.user-row .nick { font-weight: 600; font-size: 14px; min-width: 80px; }
.user-row .info { font-size: 12px; color: var(--txt-dim); flex: 1; }
.user-row .ban-info { font-size: 12px; color: var(--danger); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.badge.admin { background: var(--gold); color: #7a5a00; }
.badge.banned { background: var(--danger); color: #fff; }
.badge.normal { background: rgba(255,255,255,0.12); color: var(--txt-dim); }

@media (max-width: 520px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; }
}
