/* ─── Global ─────────────────────────────── */
body { background: #f8f9fa; font-size: 14px; }
.btn-xs { padding: 1px 6px; font-size: 12px; }
.contents { display: contents; }

/* ─── Episode link blocks ─────────────────── */
.section-header {
  border-left: 4px solid #0d6efd;
  padding-left: 8px;
  margin: 16px 0 8px;
  font-weight: bold;
}

.station-block { margin-bottom: 8px; }
.station-label {
  font-weight: bold;
  color: #444;
  margin-bottom: 4px;
  font-size: 13px;
}

.ep-links { display: flex; flex-wrap: wrap; gap: 4px; }

.ep-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  background: #e7f1ff;
  color: #0d6efd;
  border: 1px solid #b6d0f7;
  transition: background .15s;
}
.ep-link:hover { background: #cfe2ff; color: #0a58ca; }
.ep-link.ep-img { background: #e9fbe9; color: #198754; border-color: #a3d9a5; }
.ep-link.ep-img:hover { background: #c8f0c8; color: #145e3a; }
.ep-link.ep-other { background: #f5f5f5; color: #888; border-color: #ccc; font-style: italic; }
.ep-link.ep-spacer { background: transparent; border-color: transparent; pointer-events: none; color: transparent; padding-left: 20px; padding-right: 20px; }

/* ─── Stats table ────────────────────────── */
.stats-table th, .stats-table td { text-align: center; white-space: nowrap; }
.stats-table td:first-child, .stats-table th:first-child { text-align: left; }

/* ─── Thread posts ───────────────────────── */
.thread-posts { max-width: 900px; }

.post {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
}

.post-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 10px;
  background: #f0f4ff;
  font-size: 12px;
  border-bottom: 1px solid #dee2e6;
  flex-wrap: wrap;
}

.post-no {
  font-weight: bold;
  color: #666;
  min-width: 28px;
}
.post-name { color: #0d6efd; font-weight: bold; }
.post-id { font-size: 11px; }
.post-time { font-size: 11px; margin-left: auto; }

.post-body {
  padding: 8px 12px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.post-body br { display: block; content: ''; }

.inline-img {
  max-width: 300px;
  max-height: 200px;
  margin: 4px 0;
  display: block;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}
.inline-img:hover { opacity: .85; }
.img-err { color: #999; font-size: 12px; }

.anc { color: #0d6efd; text-decoration: none; }
.anc:hover { text-decoration: underline; }
.gyazo-link { color: #6610f2; }

/* ─── NG inline form ─────────────────────── */
.ng-inline-form { background: #fff3cd; border-radius: 6px; padding: 6px 12px; display:inline-block; }

/* ─── Image grid ─────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.image-item {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.image-item a { display: block; }

.image-item img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #f8f9fa;
  display: block;
}

.image-item.img-broken { display: none; }

.gyazo-placeholder {
  width: 100%;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  padding: 8px;
  word-break: break-all;
}

.image-caption {
  text-align: center;
  font-size: 11px;
  color: #888;
  padding: 2px 0;
  border-top: 1px solid #eee;
}

.copy-btn {
  display: block;
  width: calc(100% - 8px);
  margin: 4px;
  font-size: 11px;
}

/* ─── Label input ────────────────────────── */
.label-input { font-size: 12px; }

/* ─── Public thumbnail grid ──────────────── */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 1.5rem;
}
@media (max-width: 576px) {
  .thumb-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .image-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}
.thumb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, border-color .15s;
}
.thumb-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.15); border-color: #adb5bd; color: inherit; }
.thumb-num { font-size: 22px; color: #999; align-self: center; line-height: 1; margin-bottom: 4px; font-weight: bold; }
.thumb-img-wrap { width: 100%; aspect-ratio: 1/1; margin-bottom: 6px; }
.thumb-img-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #e9ecef; border-radius: 4px; font-size: 2.2rem; color: #adb5bd; }
.thumb-title { font-size: 12px; font-weight: bold; text-align: center; line-height: 1.4; color: #333; margin-bottom: 4px; }
.thumb-avg { font-size: 11px; text-align: center; color: #0dcaf0; font-weight: bold; }
