/* SmartCPS news board: compact white list, detail view with image gallery and comments */
.nb { --nb-line: #e5e7eb; --nb-muted: #6b7280; --nb-text: #111827; --nb-accent: #1d4ed8;
      background: #fff; color: var(--nb-text); max-width: 960px; margin: 0 auto; }
.nb-admin-link { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.nb button, .nb input, .nb textarea { font: inherit; }

/* list */
.nb-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--nb-line); }
.nb-row { border-bottom: 1px solid var(--nb-line); }
.nb-row a { display: flex; align-items: center; gap: 14px; padding: 10px 6px; color: inherit; text-decoration: none; }
.nb-row a:hover, .nb-row a:focus-visible { background: #f9fafb; }
/* pinned posts: pastel orange, always first on page 1 */
.nb-row.nb-pinned { background: #fff4e6; border-bottom-color: #fde3c4; }
.nb-row.nb-pinned a:hover, .nb-row.nb-pinned a:focus-visible { background: #ffecd6; }
.nb-pin { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11.5px; line-height: 18px; font-weight: 600;
          background: #ffe1bf; color: #9a4d0f; white-space: nowrap; }
.nb-thumb { flex: 0 0 80px; width: 80px; height: 60px; border-radius: 4px; overflow: hidden; background: #f3f4f6;
            display: flex; align-items: center; justify-content: center; }
.nb-thumb img { width: 80px; height: 60px; object-fit: cover; display: block; }
.nb-thumb svg { width: 28px; height: 28px; color: #9ca3af; }
.nb-title { min-width: 0; font-size: 15px; line-height: 1.45; overflow: hidden;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nb-ext { flex: 0 0 auto; font-size: 12px; color: var(--nb-muted); }
.nb-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nb-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--nb-muted); }
.nb-cat { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11.5px; line-height: 18px;
          background: #f3f4f6; color: #374151; white-space: nowrap; }
.nb-cat-award { background: #fef3c7; color: #92400e; }
.nb-cat-paper { background: #dbeafe; color: #1e40af; }
.nb-cat-project { background: #dcfce7; color: #166534; }
.nb-cat-standard { background: #ede9fe; color: #5b21b6; }
.nb-cat-talk { background: #e0f2fe; color: #075985; }
.nb-cat-people { background: #fce7f3; color: #9d174d; }
.nb-date { display: flex; align-items: center; gap: 10px; }
.nb-empty, .nb-status { padding: 28px 6px; text-align: center; color: var(--nb-muted); }
.nb-error { color: #b91c1c; }

/* search + pagination (below the list) */
.nb-tools { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 22px; }
.nb-search { display: flex; gap: 6px; width: 100%; max-width: 420px; }
.nb-search input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 4px; }
.nb-btn { height: 36px; padding: 0 14px; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; cursor: pointer; }
.nb-btn:hover:not(:disabled) { background: #f3f4f6; }
.nb-btn-primary { background: var(--nb-accent); border-color: var(--nb-accent); color: #fff; }
.nb-btn-primary:hover:not(:disabled) { background: #1e40af; }
.nb-btn:disabled { opacity: .45; cursor: not-allowed; }
.nb-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.nb-pages button { min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid var(--nb-line); border-radius: 4px;
                   background: #fff; cursor: pointer; color: var(--nb-text); }
.nb-pages button[aria-current="page"] { background: var(--nb-text); border-color: var(--nb-text); color: #fff; }
.nb-pages button:disabled { opacity: .4; cursor: default; }
.nb-pages .nb-edge { font-size: 16px; line-height: 1; }
.nb-ellipsis { display: inline-flex; align-items: flex-end; min-width: 18px; justify-content: center; color: var(--nb-muted); padding-bottom: 6px; }
/* type a page number and go there */
.nb-jump { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--nb-muted); }
.nb-jump label { font-weight: 600; color: #374151; }
.nb-jump input { width: 64px; height: 32px; padding: 0 6px; border: 1px solid #d1d5db; border-radius: 4px; text-align: center; font: inherit; color: var(--nb-text); }
.nb-jump .nb-btn { height: 32px; }
.nb-count { font-size: 13px; color: var(--nb-muted); margin: 0 0 8px 2px; }

/* detail */
.nb-back { margin-bottom: 16px; }
.nb-detail h2 { font-size: 22px; line-height: 1.4; margin: 0 0 6px; }
.nb-date { color: var(--nb-muted); font-size: 14px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--nb-line); }
.nb-hero { margin: 0 0 12px; }
.nb-hero img { display: block; max-width: 100%; max-height: 640px; margin: 0 auto; border-radius: 4px; cursor: zoom-in; }
.nb-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.nb-strip button { padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; cursor: pointer; line-height: 0; }
.nb-strip button[aria-current="true"] { border-color: var(--nb-accent); }
.nb-strip img { width: 80px; height: 60px; object-fit: cover; border-radius: 2px; }
.nb-body { white-space: pre-line; line-height: 1.8; font-size: 16px; margin: 8px 0 18px; overflow-wrap: anywhere; }
.nb-source { display: inline-block; margin-bottom: 8px; }

/* comments */
.nb-comments { margin-top: 30px; border-top: 1px solid var(--nb-line); padding-top: 18px; }
.nb-comments h3 { font-size: 17px; margin: 0 0 10px; }
.nb-comment { padding: 10px 2px; border-bottom: 1px solid var(--nb-line); }
.nb-comment-head { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.nb-comment-head strong { font-weight: 700; }
.nb-comment-head time { color: var(--nb-muted); font-size: 12px; }
.nb-comment p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.nb-form { margin-top: 16px; display: grid; gap: 8px; }
.nb-form input, .nb-form textarea { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 4px; box-sizing: border-box; }
.nb-form textarea { min-height: 90px; resize: vertical; }
.nb-form-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nb-hint { font-size: 12px; color: var(--nb-muted); }
.nb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* lightbox */
.nb-lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .86); display: none; align-items: center;
               justify-content: center; z-index: 9999; }
.nb-lightbox.open { display: flex; }
.nb-lightbox img { max-width: 92vw; max-height: 86vh; }
.nb-lightbox button { position: absolute; background: rgba(255, 255, 255, .15); color: #fff; border: 0;
                      width: 44px; height: 44px; border-radius: 22px; font-size: 22px; cursor: pointer; }
.nb-lb-close { top: 16px; right: 16px; }
.nb-lb-prev { left: 16px; top: 50%; }
.nb-lb-next { right: 16px; top: 50%; }
.nb-lb-count { position: absolute; bottom: 18px; color: #e5e7eb; font-size: 13px; }

@media (max-width: 600px) {
  .nb-title { font-size: 16px; }
  .nb-meta { font-size: 13.5px; }
  .nb-cat, .nb-pin { font-size: 12.5px; }
  /* one row of page buttons on phones: arrows only, first/last reached through 1 … N and the jump box */
  .nb-pages .nb-edge, .nb-step-label { display: none; }
  .nb-pages { gap: 3px; }
  .nb-pages button { min-width: 32px; padding: 0 6px; }
  .nb-ext, .nb-count, .nb-hint, .nb-comment-head time { font-size: 13.5px; }
  .nb-comment-head { font-size: 15px; }
  .nb-detail h2 { font-size: 21px; }
}
