.wp-app { padding-top: 6px; }
.wp-app .wp-head {
  position: sticky; top: 60px; z-index: 20;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 10px 12px 0; margin-bottom: 6px;
}
.wp-app .wp-search { position: relative; flex: 1; min-width: 0; max-width: 520px; }
.wp-app .wp-search input {
  width: 100%; height: 38px; padding: 0 86px 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2, #fafbfc);
  color: var(--ink); font-size: 13.5px; outline: none; transition: .15s;
}
.wp-app .wp-search input:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.wp-app .wp-search button {
  position: absolute; right: 4px; top: 4px; height: 30px; padding: 0 14px;
  border: 0; border-radius: 8px; background: var(--brand); color: #fff;
  font-size: 12.5px; cursor: pointer;
}
.wp-app .wp-search button:hover { background: var(--brand-2); }

.wp-app .wp-tabs { display: flex; gap: 6px; margin: 10px 0 0; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.wp-app .wp-tabs::-webkit-scrollbar { display: none; }
.wp-app .wp-tab {
  flex: 0 0 auto; padding: 5px 13px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  white-space: nowrap; transition: .15s;
}
.wp-app .wp-tab:hover { border-color: var(--brand-line); color: var(--brand); }
.wp-app .wp-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.wp-app .wp-grid { column-count: 4; column-gap: 12px; }
@media (max-width: 1180px) { .wp-app .wp-grid { column-count: 3; } }
@media (max-width: 820px) { .wp-app .wp-grid { column-count: 2; column-gap: 10px; } }
@media (max-width: 480px) { .wp-app .wp-grid { column-count: 2; column-gap: 8px; } }

.wp-app .wp-cell {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  margin: 0 0 12px; border-radius: 12px; overflow: hidden;
  background: var(--surface-3); position: relative; cursor: zoom-in;
  box-shadow: var(--shadow-sm);
}
.wp-app .wp-cell img { display: block; width: 100%; height: auto; min-height: 80px; transition: transform .35s; }
.wp-app .wp-cell:hover img { transform: scale(1.03); }
.wp-app .wp-cell .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px;
  font-size: 11.5px; color: #fff; opacity: 0; transition: .25s;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wp-app .wp-cell:hover .cap { opacity: 1; }
.wp-app .wp-cell.broken { display: none; }

.wp-app .wp-state { padding: 34px 16px 46px; text-align: center; color: var(--ink-3); font-size: 13px; }
.wp-app .wp-state.err { color: #c0392b; }
.wp-app .wp-spin {
  display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%;
  animation: wpSpin .7s linear infinite;
}
@keyframes wpSpin { to { transform: rotate(360deg); } }

.wp-app .wp-view {
  position: fixed; inset: 0; z-index: 9999; display: none;
  background: rgba(12, 14, 20, .92); backdrop-filter: blur(3px);
}
.wp-app .wp-view.on { display: flex; align-items: center; justify-content: center; }
.wp-app .wp-view img { max-width: 92vw; max-height: 86vh; border-radius: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.wp-app .wp-view-bar {
  position: absolute; left: 0; right: 0; bottom: 18px; display: flex; gap: 10px;
  justify-content: center; flex-wrap: wrap; padding: 0 16px;
}
.wp-app .wp-view-bar a {
  height: 34px; padding: 0 16px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none;
}
.wp-app .wp-view-bar a:hover { background: rgba(255, 255, 255, .22); }
.wp-app .wp-view-close {
  position: absolute; top: 16px; right: 18px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .12); color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer;
}
