/* webbbs — 论坛样式 */
:root {
  --accent: #0d6efd;
  --accent-dark: #0a58ca;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --muted: #9ca3af;
  --bg: #f3f4f6;
  --card: #ffffff;
  --line: #e5e7eb;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 14.5px;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
.desc { color: var(--muted); font-size: 13px; }

/* ---------- header ---------- */
.site-header {
  background: #111827; color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.logo { color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.logo:hover { color: #fff; }
.logo-dot { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.site-nav a { color: #d1d5db; margin-left: 16px; font-size: 14px; }
.site-nav a:hover { color: #fff; }
.site-nav .nav-new { color: #93c5fd; font-weight: 600; }
.nav-user { color: #9ca3af; margin-left: 16px; font-size: 13.5px; }
.nav-user b { color: #e5e7eb; }

.site-main { padding: 18px 16px 30px; }

/* ---------- stats ---------- */
.bbs-stats {
  display: flex; gap: 12px; margin-bottom: 16px;
}
.stat {
  flex: 1; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: baseline; gap: 8px;
}
.stat b { font-size: 22px; color: var(--accent); }
.stat span { color: var(--muted); font-size: 13px; }

/* ---------- panel ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
}
.panel-head {
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  font-weight: 600; background: #f9fafb;
  display: flex; align-items: center; justify-content: space-between;
}
.board-head .desc { margin-left: 10px; font-weight: 400; }

/* ---------- 表格 ---------- */
.board-table, .thread-table { width: 100%; border-collapse: collapse; }
.board-table th, .thread-table th {
  text-align: left; font-size: 12.5px; color: var(--muted);
  font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: #fbfbfc;
}
.board-table td, .thread-table td {
  padding: 11px 12px; border-bottom: 1px solid #f1f2f4;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
.col-board { width: 30%; }
.col-author { width: 14%; color: var(--ink-2); }
.col-num { width: 9%; text-align: center; color: var(--ink-2); }
th.col-num { text-align: center; }
.col-last { width: 19%; color: var(--muted); font-size: 13px; }
.board-name { font-weight: 600; }
.th-title { font-weight: 600; }
.th-board { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.board-table td.col-num { text-align: center; }

/* ---------- 最新主题 ---------- */
.latest-list { list-style: none; margin: 0; padding: 0; }
.latest-list li {
  padding: 10px 16px; border-bottom: 1px solid #f1f2f4;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.latest-list li:last-child { border-bottom: none; }
.lt-title { font-weight: 600; }
.lt-meta { color: var(--muted); font-size: 12.5px; }
.lt-meta a { color: var(--muted); }

/* ---------- 帖子 ---------- */
.crumbs { color: var(--muted); font-size: 13px; margin: 4px 2px 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.post-floor {
  display: flex; border-bottom: 1px solid #f1f2f4;
}
.post-floor:last-child { border-bottom: none; }
.post-first { background: #fcfdff; }
.post-side {
  width: 140px; flex-shrink: 0; padding: 14px 12px;
  border-right: 1px solid #f1f2f4; text-align: center;
}
.p-author { font-weight: 600; color: var(--accent); }
.p-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.post-main { flex: 1; padding: 12px 16px; min-width: 0; }
.post-title { margin: 0 0 4px; font-size: 20px; }
.post-info { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.post-content {
  white-space: pre-wrap; word-break: break-word;
  color: var(--ink); font-size: 14.5px;
}

/* ---------- 表单 ---------- */
.form-panel, .auth-panel { max-width: 640px; margin: 0 auto 16px; }
.bbs-form { padding: 16px; }
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block; margin-bottom: 5px; color: var(--ink-2); font-size: 13.5px;
}
.form-row input[type=text], .form-row input[type=password],
.form-row select, .form-row textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 14px; font-family: inherit; outline: none;
  background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--accent);
}
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-error {
  margin: 12px 16px 0; background: #fef2f2; color: #b91c1c;
  border: 1px solid #fecaca; border-radius: 7px; padding: 9px 14px;
  font-size: 13.5px;
}
.reply-form { padding: 16px; }
.reply-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 14px; font-family: inherit; outline: none;
  resize: vertical;
}
.reply-form textarea:focus { border-color: var(--accent); }
.reply-form .form-actions { margin-top: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 7px 18px; border-radius: 7px;
  font-size: 13.5px; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink-2); background: #fff; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 搜索 ---------- */
.search-bar { display: flex; gap: 10px; padding: 14px 16px; }
.search-bar input[type=text] {
  flex: 1; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 14px; outline: none;
}
.search-bar input[type=text]:focus { border-color: var(--accent); }

/* ---------- 分页 ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 16px; }
.page {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 7px; padding: 4px 12px; font-size: 13.5px;
}
.page:hover { border-color: var(--accent); color: var(--accent); }
.page-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-on:hover { color: #fff; }
.pager-info { color: var(--muted); font-size: 12.5px; margin-left: auto; }

/* ---------- footer / misc ---------- */
.site-footer {
  background: #111827; color: #9ca3af;
  font-size: 13px;
}
.footer-inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 18px 16px;
}
.empty-tip { padding: 40px 20px; text-align: center; color: var(--muted); }
.error-page { text-align: center; padding: 90px 16px; }
.error-page h1 { font-size: 52px; margin: 0 0 12px; color: var(--muted); }
.error-msg { color: var(--ink-2); margin-bottom: 24px; }

/* ---------- 富文本编辑器工具条 ---------- */
.editor-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 10px; background: #f9fafb;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0;
}
.editor-bar button {
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 6px; padding: 4px 10px; font-size: 12.5px; cursor: pointer;
  font-family: inherit;
}
.editor-bar button:hover { border-color: var(--accent); color: var(--accent); }
.editor-bar .hint { color: var(--muted); font-size: 12px; margin-left: auto; }
.editor-tip {
  font-size: 12.5px; color: var(--muted); padding: 4px 2px 0;
  min-height: 18px;
}
.form-row textarea[name=content] {
  border-top-left-radius: 0; border-top-right-radius: 0;
}

/* ---------- 内嵌发帖（首页/板块页折叠面板） ---------- */
.inline-post { margin-bottom: 16px; }
.inline-post .panel-head { background: #eef4ff; border-bottom-color: #dbe5f3; }
.inline-post-body { padding: 14px 16px 16px; }
.inline-post-body .form-row:last-child { margin-bottom: 0; }

/* ---------- 帖子正文富文本渲染（含图片） ---------- */
.post-content { color: var(--ink); font-size: 14.5px; line-height: 1.7; word-break: break-word; }
.post-content img {
  display: block; max-width: 100%; height: auto;
  max-height: 600px;       /* 防止大屏显示原图真实尺寸（如 4K 桌面图撑破版式） */
  object-fit: contain;
  margin: 8px 0; border-radius: 6px;
  border: 1px solid var(--line); background: #fff;
  cursor: zoom-in;          /* 提示：点击查看原图 */
}
.post-content p { margin: 0 0 8px; }
.post-content p:last-child { margin-bottom: 0; }
.post-content h2 { font-size: 18px; margin: 14px 0 8px; }
.post-content h3 { font-size: 16px; margin: 12px 0 6px; }
.post-content blockquote {
  margin: 8px 0; padding: 6px 12px;
  border-left: 3px solid var(--accent);
  background: #f3f6fc; color: var(--ink-2);
  border-radius: 0 5px 5px 0;
}
.post-content pre {
  margin: 8px 0; padding: 8px 12px;
  background: #1f2937; color: #e5e7eb;
  border-radius: 5px; font-family: Consolas, monospace;
  font-size: 13px; overflow-x: auto;
}
.post-content code {
  background: #f3f4f6; color: #1f2937;
  padding: 1px 6px; border-radius: 4px;
  font-family: Consolas, monospace; font-size: 13px;
}
.post-content ul, .post-content ol { padding-left: 22px; margin: 6px 0; }
.post-content li { margin: 2px 0; }
.post-content a { color: var(--accent); text-decoration: underline; }
.post-content b, .post-content strong { font-weight: 700; }
.post-content br { line-height: 1.4; }

@media (max-width: 640px) {
  .post-side { width: 96px; }
  .col-last { display: none; }
  th.col-last { display: none; }
  .nav-user { display: none; }
  .editor-bar .hint { display: none; }
}
