* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: #e5fffd;
  color: #222;
}

header {
  background: #193fff;
  color: #fff;
  padding: 16px 20px;
}
header h1 { margin: 0; font-size: 20px; }
header .sub { margin: 4px 0 0; font-size: 13px; opacity: 0.9; }

main { max-width: 900px; margin: 0 auto; padding: 16px; }

#search-form {
  background: #fff;
  border: 1px solid #bcd;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 12px;
}
.radios label { margin-right: 16px; font-size: 14px; cursor: pointer; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row input {
  flex: 1;
  padding: 8px 10px;
  font-size: 15px;
  border: 1px solid #99a;
  border-radius: 4px;
}
.row button {
  padding: 8px 22px;
  font-size: 15px;
  border: none;
  border-radius: 4px;
  background: #193fff;
  color: #fff;
  cursor: pointer;
}
.row button:hover { background: #0f2cc0; }

.status { margin: 8px 2px; font-size: 13px; color: #225; min-height: 1em; }
.status.error { color: #c00; }

.rank { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rank-block {
  flex: 1 1 320px;
  background: #fff;
  border: 1px solid #bcd;
  border-radius: 6px;
  padding: 10px 14px;
}
.rank-block h2 { margin: 0 0 8px; font-size: 14px; color: #444; }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank-item {
  counter-increment: rank;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-top: 1px dashed #d8e8f0;
  padding: 5px 2px;
  cursor: pointer;
  font-size: 13px;
}
.rank-item::before {
  content: counter(rank);
  color: #bbb;
  min-width: 18px;
  font-weight: bold;
}
.rank-item:hover { background: #eef6ff; }
.rank-id { font-weight: bold; color: #193fff; word-break: break-all; }
.rank-meta { color: #888; white-space: nowrap; }

.summary { background: #fff; border: 1px solid #bcd; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.summary h2 { margin: 0 0 8px; font-size: 15px; }
.summary table { border-collapse: collapse; font-size: 13px; }
.summary th { text-align: left; padding: 2px 12px 2px 0; color: #555; white-space: nowrap; }
.summary td { padding: 2px 0; }

.thread {
  background: #fff;
  border: 1px solid #bcd;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.thread-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.thread-title { font-weight: bold; color: #193fff; text-decoration: none; font-size: 15px; }
.thread-title:hover { text-decoration: underline; }
.thread-info { font-size: 12px; color: #666; }

.posts { list-style: none; margin: 0; padding: 0; }
.post { border-top: 1px dashed #cde; padding: 6px 0; }
.post-meta { font-size: 12px; color: #888; }
.post-meta a { font-weight: bold; color: #193fff; text-decoration: none; margin-right: 6px; }
.post-meta a:hover { text-decoration: underline; }
.post-meta .id-link { color: #0a7a3a; margin: 0 2px; }
.post-meta .id-link:hover { color: #c00; }
.post-body { margin-top: 2px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; }
.post-body .res-ref {
  color: #0a7a3e;
  font-weight: bold;
  text-decoration: underline dotted 1px;
  cursor: pointer;
  white-space: nowrap;
}
.post-body .res-ref:hover { color: #c00; text-decoration: underline solid 1px; }
.body-img {
  max-width: 220px;
  max-height: 220px;
  border: 1px solid #ccd;
  border-radius: 4px;
  margin: 3px 6px 3px 0;
  vertical-align: top;
  cursor: zoom-in;
}

.res-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 480px;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid #9ab;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(20, 40, 90, 0.25);
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease;
  pointer-events: auto;
}
.res-tooltip-head {
  font-size: 11.5px;
  color: #555;
  border-bottom: 1px dashed #cde;
  padding-bottom: 4px;
  margin-bottom: 6px;
  word-break: break-all;
}
.res-tooltip-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: #222;
}
.res-tooltip-body .empty { color: #999; }
