:root {
  --panel-bg: #ffffff;
  --panel-soft: #f5f5f5;
  --panel-line: #0a0a0a;
  --panel-muted: #6b7280;
}

.nav-icon {
  animation: none;
}

.search-input,
.sort-btn,
.user-menu-btn,
.board-name,
.block-header,
.section-title,
.tab-btn,
.form-label-block,
.btn-block,
.btn-block-secondary {
  text-transform: none;
}

.notice-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--panel-bg);
  border-top: 3px solid var(--panel-line);
}

a.board-item {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

.notice-title {
  font-size: 1rem;
  font-weight: 900;
}

.notice-meta {
  font-size: 0.75rem;
  color: var(--panel-muted);
}

.notice-body {
  line-height: 1.7;
  font-size: 0.92rem;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.5rem;
  align-items: start;
}

.post-article {
  min-width: 0;
}

.back-float-btn {
  position: sticky;
  top: 88px;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  background: #fff;
  border: 3px solid var(--panel-line);
  cursor: pointer;
  font-weight: 700;
}

.post-header-card,
.post-content-wrapper,
.attachments-card,
.thread-tools-row,
.comments-section,
.comment-input-section,
.login-prompt,
.related-card {
  background: var(--panel-bg);
  border: 3px solid var(--panel-line);
}

.post-header-card,
.attachments-card,
.comments-section,
.comment-input-section,
.login-prompt,
.related-card {
  margin-bottom: 1rem;
}

.post-header-card,
.post-content-wrapper,
.attachments-card,
.comments-section,
.comment-input-section,
.login-prompt,
.related-card {
  padding: 1rem;
}

.post-category-tag {
  display: inline-flex;
  padding: 0.28rem 0.6rem;
  background: #111827;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.post-title-main {
  font-size: 1.6rem;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.post-meta-row,
.post-author-row,
.post-stats-row,
.comments-header,
.comments-title-row,
.comment-input-header,
.comment-form-actions,
.comment-actions-right,
.attachments-header,
.thread-tools-row,
.reply-card-head,
.reply-card-author,
.related-header,
.login-prompt-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-meta-row,
.comments-header,
.comment-form-actions,
.attachments-header,
.reply-card-head,
.login-prompt-content {
  justify-content: space-between;
}

.author-avatar-main,
.reply-avatar,
.author-avatar-small {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  font-weight: 900;
}

.author-meta,
.reply-meta-block,
.comment-input-info {
  display: grid;
  gap: 0.2rem;
}

.author-name-main,
.reply-author-name {
  font-weight: 800;
}

.author-badge,
.reply-time,
.comments-count,
.attachments-count,
.thread-tool-count,
.mobile-action-count {
  font-size: 0.75rem;
  color: var(--panel-muted);
}

.post-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--panel-muted);
}

.post-content-main {
  line-height: 1.85;
  font-size: 1rem;
  word-break: break-word;
}

.post-content-main p,
.reply-card-body p {
  margin: 0 0 1rem;
}

.post-content-main p:last-child,
.reply-card-body p:last-child {
  margin-bottom: 0;
}

.post-content-main img,
.reply-card-body img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--panel-line);
}

.post-content-main pre,
.reply-card-body pre {
  overflow: auto;
  padding: 0.9rem;
  background: #111827;
  color: #fff;
}

.attachments-list,
.comments-list,
.related-list {
  display: grid;
  gap: 0.75rem;
}

.attachment-item,
.reply-card,
.related-item {
  border: 2px solid var(--panel-line);
  background: #fff;
  padding: 0.85rem;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.attachment-info {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.attachment-name,
.related-title {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta,
.related-meta,
.related-item-empty,
.login-prompt-content span {
  font-size: 0.82rem;
  color: var(--panel-muted);
}

.thread-tools-row {
  padding: 0;
  overflow: hidden;
}

.thread-tool-btn {
  flex: 1;
  min-height: 52px;
  border: 0;
  border-right: 2px solid var(--panel-line);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.thread-tool-btn:last-child {
  border-right: 0;
}

.thread-tool-btn.active,
.mobile-action-btn.active {
  background: #111827;
  color: #fff;
}

.thread-tool-btn-danger {
  color: #b91c1c;
}

.comments-sort {
  display: flex;
  gap: 0.5rem;
}

.sort-option {
  border: 2px solid var(--panel-line);
  background: #fff;
  padding: 0.45rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.sort-option.active {
  background: #111827;
  color: #fff;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
}

.empty-icon-large {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.empty-title {
  font-weight: 900;
  margin-bottom: 0.35rem;
}

.comment-textarea {
  box-sizing: border-box;
}

.btn-login-prompt,
.attachment-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: 2px solid var(--panel-line);
  background: #111827;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.related-sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 88px;
}

.mobile-action-bar,
.mobile-actions-sheet {
  display: none;
}

.mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 0.45rem;
  background: #fff;
  border-top: 3px solid var(--panel-line);
  gap: 0.4rem;
}

.mobile-action-btn {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  border: 2px solid var(--panel-line);
  background: #fff;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.mobile-action-count {
  line-height: 1;
}

.mobile-actions-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  align-items: flex-end;
  justify-content: center;
}

.mobile-actions-content {
  width: min(520px, 100%);
  background: #fff;
  border-top: 3px solid var(--panel-line);
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.mobile-sheet-btn {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--panel-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
}

.mobile-sheet-cancel {
  background: #111827;
  color: #fff;
}

@media (max-width: 992px) {
  .detail-container {
    grid-template-columns: 1fr;
  }

  .related-sidebar,
  .back-float-btn {
    position: static;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-action-bar {
    display: flex;
  }

  .detail-container {
    gap: 1rem;
  }

  .post-header-card,
  .post-content-wrapper,
  .attachments-card,
  .comments-section,
  .comment-input-section,
  .login-prompt,
  .related-card {
    padding: 0.9rem;
  }

  .post-title-main {
    font-size: 1.2rem;
  }

  .post-meta-row,
  .comments-header,
  .comment-form-actions,
  .attachment-item,
  .reply-card-head,
  .login-prompt-content {
    flex-direction: column;
    align-items: stretch;
  }

  .comment-actions-right {
    width: 100%;
  }

  .btn-comment-secondary,
  .btn-submit-comment,
  .btn-login-prompt,
  .attachment-download-btn {
    width: 100%;
    justify-content: center;
  }

  .comment-actions-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .related-sidebar {
    padding-bottom: 5rem;
  }
}
