.hashtag-editor {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfc;
}

.hashtag-editor-head,
.hashtag-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hashtag-editor-head b,
.hashtag-source b {
  font-size: 11px;
}

.hashtag-editor-head small,
.hashtag-source small {
  display: block;
  margin-top: 4px;
  color: #858a94;
  font-size: 9px;
  line-height: 1.5;
}

.selected-hashtags {
  min-height: 31px;
  margin-top: 10px;
}

.hashtag-tag {
  border: 1px solid #dbd9fb;
  cursor: pointer;
}

.hashtag-tag:hover {
  border-color: var(--red);
  color: var(--red);
}

.hashtag-recommendations {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.hashtag-source > div:last-child {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.hashtag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  max-height: 430px;
  overflow: auto;
}

.hashtag-candidate {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 3px 7px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e3e8;
  border-radius: 10px;
  background: #fff;
  color: #444952;
  text-align: left;
}

.hashtag-candidate:hover,
.hashtag-candidate.chosen {
  border-color: var(--violet);
  background: var(--violet-soft);
}

.hashtag-candidate.chosen::after {
  content: "已选";
  grid-column: 3;
  grid-row: 2;
  color: var(--violet);
  font-size: 8px;
  font-weight: 900;
}

.hashtag-rank {
  grid-row: 1 / span 3;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0efff;
  color: var(--violet);
  font-size: 9px;
  font-weight: 900;
}

.hashtag-candidate b {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
}

.hashtag-candidate strong {
  color: var(--violet);
  font-size: 13px;
}

.hashtag-candidate small,
.hashtag-candidate em {
  grid-column: 2 / 4;
  overflow: hidden;
  color: #858a94;
  font-size: 8px;
  font-style: normal;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hashtag-candidate em {
  color: #656b75;
}

.background-tools {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfbfc;
}

.background-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.background-actions label {
  flex: 1;
  margin: 0;
}

.background-recommendations {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.background-source {
  color: #858a94;
  font-size: 9px;
  line-height: 1.5;
}

.background-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid #e1e2e7;
  border-radius: 9px;
  background: #fff;
  text-align: left;
}

.background-card:hover {
  border-color: var(--violet);
}

.background-swatch {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 9px;
}

.background-card b,
.background-card small {
  display: block;
}

.background-card b {
  font-size: 10px;
}

.background-card small {
  margin-top: 3px;
  color: #858a94;
  font-size: 8px;
  line-height: 1.45;
}

.background-card strong {
  color: var(--violet);
  font-size: 13px;
}

.media-preview {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid #e1e2e7;
  border-radius: 12px;
  background: #f8f8fa;
}

.media-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.media-preview-head b,
.media-preview-head small {
  display: block;
}

.media-preview-head small {
  margin-top: 3px;
  color: #858a94;
  font-size: 9px;
}

.media-preview-head > span {
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.media-preview-card {
  overflow: hidden;
  border: 1px solid #e1e2e7;
  border-radius: 10px;
  background: #fff;
}

.media-preview-card.processed {
  border-color: rgba(110, 92, 255, .45);
  box-shadow: 0 0 0 2px rgba(110, 92, 255, .08);
}

.media-preview-card > a {
  display: block;
  background-color: #f1f2f5;
  background-image: linear-gradient(45deg, #e6e7eb 25%, transparent 25%), linear-gradient(-45deg, #e6e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6e7eb 75%), linear-gradient(-45deg, transparent 75%, #e6e7eb 75%);
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-size: 14px 14px;
}

.media-preview-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.media-preview-info {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px 7px;
  padding: 9px;
}

.media-preview-info b {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview-info small {
  grid-column: 1 / -1;
  color: #858a94;
  font-size: 8px;
}

.media-preview-info > a {
  grid-column: 1 / -1;
  color: var(--violet);
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}

.media-preview-badge {
  padding: 3px 5px;
  border-radius: 5px;
  background: #ececf1;
  color: #575b65;
  font-size: 8px;
  font-weight: 700;
}

.processed .media-preview-badge {
  background: rgba(110, 92, 255, .12);
  color: var(--violet);
}

.processed-media-gallery {
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid rgba(110, 92, 255, .22);
  border-radius: 12px;
  background: rgba(110, 92, 255, .045);
}

.processed-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.processed-gallery-head b,
.processed-gallery-head small {
  display: block;
}

.processed-gallery-head small {
  margin-top: 3px;
  color: #858a94;
  font-size: 9px;
}

.processed-gallery-head > span {
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
}

.processed-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.processed-gallery-card {
  overflow: hidden;
  border: 1px solid #e1e2e7;
  border-radius: 10px;
  background: #fff;
}

.processed-gallery-card > a,
.processed-gallery-card img {
  display: block;
  width: 100%;
}

.processed-gallery-card img {
  aspect-ratio: 1;
  object-fit: contain;
  background: #f4f5f7;
}

.processed-gallery-card > div {
  display: grid;
  gap: 5px;
  padding: 9px;
}

.processed-gallery-card b {
  font-size: 10px;
}

.processed-gallery-card small {
  overflow: hidden;
  color: #858a94;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .hashtag-grid {
    grid-template-columns: 1fr;
  }

  .hashtag-editor-head,
  .hashtag-source,
  .background-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .media-preview-grid {
    grid-template-columns: 1fr;
  }

  .processed-gallery-grid {
    grid-template-columns: 1fr;
  }
}
