.board-shell {
  max-width: 1040px;
  margin: 24px auto;
  padding: 0 16px;
}
.board-form-shell { max-width: 760px; }
.board-heading-row,
.board-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.board-heading-row h1,
.board-post-header h1 { margin: 0 0 8px; }
.board-muted,
.board-kicker { color: var(--muted); margin: 0; }
.board-button,
.board-back,
.board-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.board-button-secondary,
.board-back,
.board-tab {
  background: var(--card);
  color: var(--brand);
}
.board-button-danger { background: #b91c1c; border-color: #b91c1c; }
.board-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.board-tab.is-active { background: var(--brand); color: #fff; }
.board-list { display: grid; gap: 10px; }
.board-list-item,
.board-detail,
.board-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.board-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
}
.board-list-item-free { grid-template-columns: 128px minmax(0, 1fr); }
.board-list-main {
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.board-list-title { min-width: 0; overflow-wrap: anywhere; }
.board-post-type { color: var(--brand); flex: 0 0 auto; }
.board-pin,
.board-video-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.board-list-media { grid-row: span 2; width: 128px; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f9fafb; text-decoration: none; }
.board-list-media img,
.board-list-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.board-list-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 13px; }
.board-empty { margin: 0; color: var(--muted); }
.board-messages { margin: 0 0 16px; padding: 12px 16px; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 8px; color: #166534; list-style: none; }
.board-detail-actions,
.board-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.board-post-header { margin-bottom: 16px; }
.board-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.board-detail-layout > * { min-width: 0; }
.board-detail-layout-text-only { display: block; }
.board-media-panel { display: grid; gap: 12px; min-width: 0; max-width: 100%; }
.board-media-item { margin: 0; min-width: 0; max-width: 100%; }
.board-media-item .haidox-media-frame {
  --haidox-media-frame-width: 100%;
  --haidox-media-frame-height: min(64vh, 720px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
}
.board-media-item figcaption { margin-top: 6px; color: var(--muted); font-size: 13px; }
.board-content-panel { line-height: 1.65; overflow-wrap: anywhere; }
.board-form { display: grid; gap: 14px; }
.board-form-media { display: grid; gap: 8px; }
.board-form-section-title { font-weight: 700; }
.board-form-media-list,
.board-upload-preview-list { display: flex; flex-wrap: wrap; gap: 8px; }
.board-form-media-item,
.board-upload-preview-item { width: 116px; display: grid; gap: 6px; align-content: start; color: var(--muted); font-size: 12px; }
.board-form-media-preview,
.board-upload-preview-item img,
.board-upload-preview-item video { width: 116px; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f9fafb; }
.board-form-media-preview img,
.board-form-media-preview video,
.board-upload-preview-item img,
.board-upload-preview-item video { height: auto; object-fit: cover; display: block; }
.board-form-media-preview img,
.board-form-media-preview video { width: 100%; height: 100%; }
.board-form-media-check { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.board-form .board-form-media-item { font-weight: 400; }
.board-upload-preview-item img,
.board-upload-preview-item video { height: 87px; object-fit: cover; }
.board-upload-preview { display: grid; gap: 8px; }
.board-upload-preview[hidden] { display: none; }
.board-upload-preview-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-form label { display: grid; gap: 6px; font-weight: 700; }
.board-form .board-form-check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.board-form .board-form-check input { width: auto; }
.board-form input[type="text"],
.board-form input[type="file"],
.board-form select,
.board-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
.board-form textarea { resize: vertical; min-height: 220px; }
.board-form-errors,
.errorlist { color: #b91c1c; margin: 0; }
.errorlist { padding-left: 18px; font-weight: 400; }

.board-comments {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.board-comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.board-comments-head h2 { margin: 0; font-size: 22px; }
.board-comments-head span { color: var(--muted); font-size: 13px; }
.board-comment-form,
.board-comment,
.board-comment-delete-preview {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.board-comment-form { display: grid; gap: 8px; }
.board-comment-form label { font-weight: 700; }
.board-comment-form textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.board-comment-list { display: grid; gap: 10px; }
.board-comment { display: grid; gap: 8px; }
.board-comment-meta,
.board-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.board-comment-meta { color: var(--muted); font-size: 13px; }
.board-comment-meta strong { color: var(--text); }
.board-comment-body { line-height: 1.55; overflow-wrap: anywhere; }
.board-comment-body p,
.board-comment-delete-preview p { margin: 0 0 8px; }
.board-comment-body p:last-child,
.board-comment-delete-preview p:last-child { margin-bottom: 0; }
.board-comment-actions a { color: var(--brand); font-size: 13px; text-decoration: none; }
.board-comment-actions span { color: var(--muted); font-size: 13px; }

.board-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}
.board-reply-form textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  resize: vertical;
}
.board-reply-list {
  display: grid;
  gap: 8px;
  margin-left: 24px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
.board-reply { background: #f9fafb; }
@media (max-width: 720px) {
  .board-reply-form { grid-template-columns: 1fr; }
  .board-reply-list { margin-left: 8px; }
}

.board-manage-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.board-manage-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 4px;
}
.board-manage-stat strong { font-size: 24px; }
.board-manage-stat span { color: var(--muted); font-size: 13px; }
.board-manage-form { margin-top: 16px; }
.board-table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.board-table { width: max-content; min-width: 100%; border-collapse: collapse; table-layout: auto; }
.board-table th,
.board-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
.board-table th { font-size: 13px; color: var(--muted); background: #f9fafb; }
.board-table tr:last-child td { border-bottom: 0; }

.board-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.board-page-link,
.board-page-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.board-page-current { color: var(--muted); }
@media (max-width: 720px) {
  .board-heading-row,
  .board-detail-head { align-items: flex-start; flex-direction: column; }
  .board-manage-stats { grid-template-columns: 1fr; }
  .board-list-item,
  .board-list-item-free { grid-template-columns: 92px minmax(0, 1fr); }
  .board-list-item:not(.board-list-item-free) { grid-template-columns: minmax(0, 1fr); }
  .board-list-media { grid-row: span 2; width: 92px; }
  .board-list-main { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 920px) and (max-height: 540px) and (orientation: landscape) {
  .board-detail-layout:not(.board-detail-layout-text-only) { grid-template-columns: minmax(0, 1.08fr) minmax(240px, .92fr); }
  .board-media-item .haidox-media-frame { --haidox-media-frame-height: 58vh; }
  .board-content-panel { max-height: 58vh; overflow: auto; padding-right: 4px; }
}
