.xh-assets-picker-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.22), rgba(15, 23, 42, 0.72));
}

.xh-assets-picker-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.xh-assets-picker-copy strong {
  color: #e0f2fe;
  font-size: 14px;
}

.xh-assets-picker-copy span {
  color: rgba(186, 230, 253, 0.88);
  font-size: 12px;
  line-height: 1.45;
}

.xh-assets-picker-cancel {
  appearance: none;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.xh-assets-picker-cancel:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.xh-assets-card.is-pickable {
  position: relative;
  overflow: visible;
}

.xh-assets-card.is-pickable .xh-assets-media {
  cursor: pointer;
}

.xh-assets-card.is-pickable .xh-assets-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(2, 8, 23, 0.55));
  pointer-events: none;
}

.xh-assets-pick-btn {
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.95);
  color: #04101a;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(2, 8, 23, 0.35);
}

.xh-assets-pick-btn:hover {
  background: #38bdf8;
}

.xh-assets-panel.is-picker-mode .xh-assets-card-meta {
  padding-right: 8px;
}

.tool-page-shell.is-history-page .secondary-topbar {
  align-items: center;
  min-height: 72px;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 20px;
}

.tool-page-shell.is-history-page .secondary-page-kicker {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(125, 211, 252, 0.95);
}

.tool-page-shell.is-history-page .secondary-page-title {
  font-size: 1.125rem;
  letter-spacing: 0.01em;
}

.tool-page-shell.is-history-page .secondary-page-desc {
  margin-top: 4px;
  max-width: min(720px, 58vw);
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(203, 213, 225, 0.88);
}

.tool-page-shell.is-history-page .secondary-page-body {
  padding: 14px 20px 24px;
}

.tool-page-shell.is-history-page .btn-chat-history-top {
  display: none;
}

.secondary-page-panel.xh-assets-panel-host {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.xh-assets-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 20px;
  min-height: 100%;
  width: 100%;
}

.xh-assets-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.xh-assets-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.xh-assets-filter-label {
  flex: 0 0 auto;
  min-width: 36px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.95);
}

.xh-assets-filters {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.xh-assets-filter {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.55);
  color: rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.xh-assets-filter.is-active {
  border-color: rgba(125, 211, 252, 0.7);
  background: rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
}

.xh-assets-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 920px;
}

.xh-assets-history-list[hidden],
.xh-assets-grid[hidden] {
  display: none !important;
}

.xh-assets-history-item {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.xh-assets-history-open {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.xh-assets-history-open:hover {
  background: rgba(56, 189, 248, 0.08);
}

.xh-assets-history-thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(148, 163, 184, 0.95);
  font-size: 20px;
}

.xh-assets-history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.xh-assets-history-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.xh-assets-history-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.96);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xh-assets-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
}

.xh-assets-history-tag {
  color: rgba(125, 211, 252, 0.88);
}

.xh-assets-inline-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: #7dd3fc;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 2px;
}

.xh-assets-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(148, 163, 184, 0.9);
}

.xh-assets-status {
  font-size: 0.875rem;
  color: rgba(226, 232, 240, 0.72);
  padding: 28px 8px;
  text-align: center;
}

.xh-assets-status.is-error {
  color: #fca5a5;
}

.xh-assets-status[hidden] {
  display: none;
}

.xh-assets-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.xh-assets-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.xh-assets-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  aspect-ratio: 4 / 5;
  background: #0b1220;
  overflow: hidden;
}

.xh-assets-card--video .xh-assets-media {
  aspect-ratio: 4 / 5;
}

.xh-assets-media img,
.xh-assets-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0b1220;
  pointer-events: none;
}

.xh-assets-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.xh-assets-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  pointer-events: none;
}

.xh-assets-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 12px;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.95);
}

.xh-assets-kind {
  color: #bae6fd;
  font-weight: 600;
}

.xh-assets-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}

.xh-assets-page-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.7);
  color: rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
}

.xh-assets-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.xh-assets-page-label {
  font-size: 0.8125rem;
  color: rgba(148, 163, 184, 0.9);
}

html.xh-assets-lightbox-open,
body.xh-assets-lightbox-open {
  overflow: hidden;
}

.xh-assets-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.xh-assets-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
}

.xh-assets-lightbox-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 18px 20px 20px;
}

.xh-assets-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 420px);
  gap: 18px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.xh-assets-detail-preview {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.72);
  overflow: hidden;
}

.xh-assets-lightbox-video,
.xh-assets-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #020617;
}

.xh-assets-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.xh-assets-nav {
  position: absolute;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.xh-assets-nav--prev {
  top: 50%;
  transform: translateY(-54px);
}

.xh-assets-nav--next {
  top: 50%;
  transform: translateY(14px);
}

.xh-assets-detail-side {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.88);
  overflow: auto;
}

.xh-assets-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.xh-assets-tool-btn,
.xh-assets-mini-btn,
.xh-assets-primary-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  cursor: pointer;
}

.xh-assets-tool-btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.7);
  color: rgba(226, 232, 240, 0.95);
  padding: 8px 12px;
  font-size: 13px;
}

.xh-assets-tool-btn--danger {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
}

.xh-assets-detail-block {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xh-assets-detail-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #f8fafc;
  font-size: 14px;
}

.xh-assets-mini-btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.7);
  color: rgba(226, 232, 240, 0.95);
  padding: 5px 10px;
  font-size: 12px;
}

.xh-assets-detail-prompt {
  margin: 0;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 42vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.95);
}

.xh-assets-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.xh-assets-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.9);
  background: rgba(51, 65, 85, 0.55);
}

.xh-assets-detail-time {
  margin: 0;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
}

.xh-assets-detail-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.xh-assets-primary-btn {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}

.xh-assets-primary-btn--accent {
  border-color: rgba(244, 114, 182, 0.55);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.85), rgba(124, 58, 237, 0.9));
}

@media (max-width: 960px) {
  .xh-assets-detail {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .xh-assets-detail-preview {
    min-height: 42vh;
  }

  .xh-assets-lightbox-video,
  .xh-assets-lightbox-image {
    max-height: 48vh;
  }
}

@media (max-width: 1400px) {
  .xh-assets-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .xh-assets-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tool-page-shell.is-history-page .secondary-page-desc {
    max-width: none;
  }

  .xh-assets-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .xh-assets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tool-page-shell.is-history-page .secondary-topbar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .tool-page-shell.is-history-page .secondary-topbar-tools {
    width: 100%;
    justify-content: flex-end;
  }

  .xh-assets-grid {
    grid-template-columns: 1fr;
  }
}
