:root {
  --pin-toolbar-blue: #1677e8;
  --pin-toolbar-blue-strong: #0f5fbd;
  --pin-toolbar-border: #dce4ef;
  --pin-toolbar-panel: #ffffff;
  --pin-toolbar-icon: #667085;
}

#threadlist .th {
  padding: 9px 12px !important;
}

#threadlist .th table,
#threadlist .th tbody,
#threadlist .th tr {
  display: block;
  width: 100%;
}

#threadlist .th tr {
  min-height: 32px;
}

#threadlist .th th {
  display: block;
  width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
}

#threadlist .th td.by,
#threadlist .th td.num {
  display: none !important;
}

#threadlist .pin-thread-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 32px;
  text-align: left;
}

#threadlist .pin-thread-sortbox {
  position: relative;
}

#threadlist .pin-thread-sortbox:after {
  content: "";
  position: absolute;
  top: 50%;
  right: 11px;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1px solid var(--pin-toolbar-icon);
  border-bottom: 1px solid var(--pin-toolbar-icon);
  transform: rotate(45deg);
  pointer-events: none;
}

#threadlist .pin-thread-sort-select {
  width: 270px;
  height: 32px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--pin-toolbar-border) !important;
  border-radius: 5px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--pin-toolbar-panel) !important;
  color: #344054 !important;
  font-size: 12px;
  line-height: 32px;
}

#threadlist .pin-thread-sort-select:focus {
  border-color: var(--pin-toolbar-blue) !important;
  box-shadow: 0 0 0 2px rgba(22, 119, 232, 0.12);
}

#threadlist .pin-view-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#threadlist .pin-view-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--pin-toolbar-border) !important;
  border-radius: 5px;
  background-color: var(--pin-toolbar-panel) !important;
  color: var(--pin-toolbar-icon) !important;
  text-decoration: none !important;
}

#threadlist .pin-view-btn span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

#threadlist .pin-view-btn:before {
  content: "";
  display: block;
}

#threadlist .pin-view-grid:before {
  width: 14px;
  height: 14px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) 8px 0 / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) 0 8px / 6px 6px no-repeat,
    linear-gradient(currentColor 0 0) 8px 8px / 6px 6px no-repeat;
}

#threadlist .pin-view-list:before {
  width: 15px;
  height: 12px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 15px 2px no-repeat,
    linear-gradient(currentColor 0 0) 0 5px / 15px 2px no-repeat,
    linear-gradient(currentColor 0 0) 0 10px / 15px 2px no-repeat;
}

#threadlist .pin-view-newwin:before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-sizing: border-box;
}

#threadlist .pin-view-newwin:after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  box-sizing: border-box;
}

#threadlist .pin-view-newwin.is-active:after {
  top: 7px;
  right: 7px;
}

#threadlist .pin-view-btn:hover,
#threadlist .pin-view-btn.is-active {
  border-color: var(--pin-toolbar-blue-strong) !important;
  background-color: var(--pin-toolbar-blue) !important;
  color: #ffffff !important;
}

#threadlist .pin-filter-legacy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

#nv_search #threadlist .pin-search-thread {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0 !important;
  border-bottom: 1px solid #e5e9f0;
}

#nv_search #threadlist .pin-search-thread:last-child {
  border-bottom: 0;
}

#nv_search #threadlist .pin-search-thumb {
  position: relative;
  flex: 0 0 118px;
  width: 118px;
  height: 82px;
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background: #f4f7fb;
}

#nv_search #threadlist .pin-search-thumb:before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(100deg, #eef3f8 8%, #f8fbff 18%, #eef3f8 33%);
  background-size: 220% 100%;
  pointer-events: none;
}

#nv_search #threadlist .pin-search-thumb.is-loading:before {
  opacity: 1;
  animation: pin-ibook-shimmer 1.15s linear infinite;
}

#nv_search #threadlist .pin-search-thumb img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.18s ease;
}

#nv_search #threadlist .pin-search-thumb.is-loaded img {
  opacity: 1;
}

#nv_search #threadlist .pin-search-thumb.is-empty:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f3f6f9, #e9eef4);
}

#nv_search #threadlist .pin-search-body {
  flex: 1 1 auto;
  min-width: 0;
}

#nv_search #threadlist .pin-search-body h3 {
  margin: 0 0 5px;
  line-height: 1.45;
}

#nv_search #threadlist .pin-search-body p {
  margin: 4px 0 0;
}

#nv_search #threadlist .pin-search-body p:nth-of-type(2) {
  color: #4b5563;
  line-height: 1.7;
}

#threadlist #waterfall.pin-ibook-waterfall {
  margin: 0;
  padding: 18px 0 8px;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-card {
  box-sizing: border-box;
  margin: 0 16px 18px 0 !important;
  padding: 0 !important;
  border: 1px solid #d9e3ee;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(26, 40, 60, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-card:hover {
  border-color: #a9c6e8;
  box-shadow: 0 16px 34px rgba(31, 74, 120, 0.15);
  transform: translateY(-2px);
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-coverwrap {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-cover {
  position: relative;
  display: block;
  float: none !important;
  width: 100%;
  height: var(--pin-ibook-thumb-height, auto);
  min-height: var(--pin-ibook-thumb-height, 132px);
  max-height: var(--pin-ibook-thumb-height, none);
  overflow: hidden;
  background: #f2f5f8;
  color: #7b8797;
  text-decoration: none !important;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-cover:before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(100deg, #eef3f8 8%, #f8fbff 18%, #eef3f8 33%);
  background-size: 220% 100%;
  pointer-events: none;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-cover.is-loading:before {
  opacity: 1;
  animation: pin-ibook-shimmer 1.15s linear infinite;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-cover img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100% !important;
  height: var(--pin-ibook-thumb-height, auto);
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.18s ease;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-cover.is-loaded img {
  opacity: 1;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-cover.is-empty {
  background: linear-gradient(135deg, #f3f6f9, #e9eef4);
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-cover.is-empty:after {
  content: "No cover";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7b8797;
  font-weight: 700;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-cover .nophoto {
  display: none !important;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-title {
  min-height: 44px;
  margin: 0 !important;
  padding: 12px 13px 0;
  border: 0 !important;
  background: #fff !important;
  line-height: 1.42;
  overflow: hidden;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-title a {
  display: -webkit-box;
  color: #17202c !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-title a:hover {
  color: #1f6fd2 !important;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin: 0 !important;
  padding: 9px 13px 13px;
  border-top: 1px solid #eef2f6;
  color: #64748b;
  font-size: 12px;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-meta .y {
  float: none;
  color: #64748b;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-meta a {
  color: #3f5878;
  text-decoration: none !important;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #dfe7f1;
  border-radius: 5px;
  background: #f8fafc;
  color: #53657d !important;
  font-size: 12px;
  line-height: 24px;
  text-decoration: none !important;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-pill strong {
  color: #17202c;
  font-weight: 700;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-like {
  cursor: pointer;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-like:hover,
#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-like.is-busy {
  border-color: #b9d4f3;
  background: #eef6ff;
  color: #1769d8 !important;
}

#threadlist #waterfall.pin-ibook-waterfall .pin-ibook-author-hook {
  display: none !important;
}

@keyframes pin-ibook-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pin-mobile-theme-toggle {
  position: fixed;
  right: 14px;
  bottom: 76px;
  z-index: 9999;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--dz-BOR-ed, #d9e3ee);
  border-radius: 50%;
  background: var(--dz-BG-0, #fff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.pin-mobile-theme-toggle span {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #1e7ee8;
}

.pin-mobile-theme-toggle span:after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--dz-BG-0, #fff);
}

html.pin-mobile-dark .pin-mobile-theme-toggle {
  border-color: #334155;
  background: #111827;
}

html.pin-mobile-dark .pin-mobile-theme-toggle span {
  background: #facc15;
}

html.pin-mobile-dark .pin-mobile-theme-toggle span:after {
  opacity: 0;
}

html.pin-mobile-dark body {
  --dz-BG-body:#0f172a;
  --dz-BG-color:#2f8df6;
  --dz-BG-0:#111827;
  --dz-BG-1:#e5e7eb;
  --dz-BG-5:#182235;
  --dz-BG-6:#334155;
  --dz-BG-n:#1e3a5f;
  --dz-FC-color:#60a5fa;
  --dz-FC-fff:#ffffff;
  --dz-FC-333:#e5e7eb;
  --dz-FC-666:#cbd5e1;
  --dz-FC-777:#b6c2d2;
  --dz-FC-888:#94a3b8;
  --dz-FC-999:#7f8ea3;
  --dz-FC-aaa:#64748b;
  --dz-FC-bbb:#526176;
  --dz-FC-ccc:#475569;
  --dz-FC-ddd:#334155;
  --dz-BOR-ed:#263244;
  background: #0f172a !important;
  color: #e5e7eb;
}

html.pin-mobile-dark body,
html.pin-mobile-dark .bodybox,
html.pin-mobile-dark .threadlist,
html.pin-mobile-dark .forumlist,
html.pin-mobile-dark .bm,
html.pin-mobile-dark .cl,
html.pin-mobile-dark .postlist {
  border-color: #263244 !important;
}

html.pin-mobile-dark a {
  color: #93c5fd;
}

html.pin-mobile-dark input,
html.pin-mobile-dark textarea,
html.pin-mobile-dark select {
  border-color: #334155 !important;
  background: #111827 !important;
  color: #e5e7eb !important;
}

@media screen and (max-width: 760px) {
  #nv_search #threadlist .pin-search-thread {
    gap: 10px;
    padding: 12px 0 !important;
  }

  #nv_search #threadlist .pin-search-thumb {
    flex-basis: 92px;
    width: 92px;
    height: 68px;
  }
}

@media screen and (min-width: 761px) {
  .pin-mobile-theme-toggle {
    display: none !important;
  }
}
