/* UI3 desktop refinement overlay. Load after round2 and its adapter. */

/* Compact, neutral quantity and credit controls. */
html body > header#siteHeader#siteHeader.pearl-header .points-pill {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 9px !important;
  border-color: rgb(255 255 255 / 10%) !important;
  background: transparent !important;
  color: #8e949e !important;
}

html body > header#siteHeader#siteHeader.pearl-header .points-pill i {
  background: #8e949e !important;
  box-shadow: none !important;
}

html body #siteHeader .globalStudioSearch:focus-within {
  box-shadow: 0 0 0 2px #7d9dff !important;
}

html body #siteHeader .globalStudioSearch input:focus-visible {
  outline: 2px solid #7d9dff !important;
  outline-offset: -2px !important;
}

html body #homeView .txMasterHomeMeta {
  color: #aeb4bd !important;
}

html body #homeView #pearlCuratedGrid .curated-card .featuredPill,
html body #exploreView #pearlExploreGrid .curated-card .featuredPill {
  border: 1px solid rgb(255 255 255 / 18%) !important;
  background: #0b0c10 !important;
  color: #f4f5f7 !important;
  opacity: 1 !important;
}

html body #homeView .txMasterNowKicker,
html body #homeView .txMasterNowCopy > p {
  color: #9299a3 !important;
}

html body #homeView .pearl-count-options {
  min-height: 32px !important;
  gap: 1px !important;
  padding: 2px !important;
  border-radius: 8px !important;
}

html body #homeView .pearl-count-option {
  width: 28px !important;
  min-width: 28px !important;
  min-height: 26px !important;
  border-radius: 6px !important;
  font-size: 10px !important;
}

html body #homeView .homeQuickPrompt:focus-within,
html body #homeView .homePlazaSearch:focus-within {
  box-shadow: 0 0 0 2px #7d9dff !important;
}

html body #homeView .homeQuickPrompt textarea:focus-visible,
html body #homeView .homePlazaSearch input:focus-visible {
  outline: 2px solid #7d9dff !important;
  outline-offset: -2px !important;
}

/* Keep the creation prompt visibly focused after the later outline reset. */
html body #tko-creator-prompt:focus-visible,
html body #shortfilmPrompt:focus-visible,
html body #shortfilmForm.txb-composer #shortfilmPrompt:focus-visible {
  outline: 2px solid #7d9dff !important;
  outline-offset: -2px !important;
}

html body #homeView .pearl-cost {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 2px !important;
  border: 0 !important;
  background: transparent !important;
  color: #858b95 !important;
  font-size: 9px !important;
}

html body #homeView .pearl-cost::after {
  content: " 积分";
}

html body #homeView .pearl-cost b {
  font-size: 9px !important;
  font-weight: 500 !important;
}

html body .tko-unified-composer .tko-points-pill {
  min-height: 30px !important;
  padding: 0 5px !important;
  border: 0 !important;
  background: transparent !important;
  color: #858b95 !important;
  font-size: 9px !important;
}

html body .tko-unified-composer .tko-points-pill .icon {
  display: none !important;
}

html body .tko-unified-composer .tko-points-pill b {
  color: #aeb4bd !important;
  font-weight: 500 !important;
}

/* iOS-like compact creation type switcher. */
html body .tko-unified-composer .tko-popover[hidden] {
  display: none !important;
}

html body .tko-unified-composer .tko-mode-menu {
  display: grid !important;
  width: 260px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 3px !important;
  padding: 5px !important;
  border-radius: 12px !important;
  background: #23252a !important;
}

html body .tko-unified-composer .tko-mode-menu > p {
  display: none !important;
}

html body .tko-unified-composer .tko-mode-menu button {
  display: flex !important;
  width: 100% !important;
  min-height: 42px !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  color: #858b95 !important;
  font-size: 11px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

html body .tko-unified-composer .tko-mode-menu button:hover,
html body .tko-unified-composer .tko-mode-menu button.is-selected {
  background: rgb(255 255 255 / 8.5%) !important;
  color: #eef0f3 !important;
}

html body .tko-unified-composer .tko-mode-menu .tko-selected-check {
  display: none !important;
}

/* Keep the settings sheet compact and constrain options to real capabilities. */
html body .tko-unified-composer .tko-settings {
  width: 370px !important;
  padding: 13px !important;
  border-radius: 12px !important;
  background: #222429 !important;
}

html body .tko-unified-composer .tko-ratio-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

html body .tko-unified-composer .tko-ratio-grid button {
  min-height: 62px !important;
}

html body .tko-unified-composer[data-mode="video"] .tko-ratio-grid [data-tko-ratio="1:1"],
html body .tko-unified-composer[data-mode="video"] .tko-ratio-grid [data-tko-ratio="4:3"],
html body .tko-unified-composer[data-mode="video"] .tko-ratio-grid [data-tko-ratio="3:4"],
html body .tko-unified-composer[data-mode="image"] .tko-count-row button:nth-child(n+4) {
  display: none !important;
}

html body .tko-unified-composer[data-mode="image"] .tko-ratio-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

html body .tko-unified-composer[data-mode="image"] .tko-count-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* 720P is a fixed backend capability, not an interface option. */
html body .tko-unified-composer .tko-settings-button small,
html body .tko-unified-composer .tko-resolution-option {
  display: none !important;
}

/* First-frame evidence stays sharp; only non-selected neighbours are dimmed. */
html body #shortfilmView .txMasterBMedia > img,
html body #shortfilmView .txMasterBMedia > video,
html body #shortfilmView .sfResultPoster {
  filter: none !important;
  image-rendering: auto !important;
  object-fit: contain !important;
  background: #050608 !important;
}

html body #shortfilmView .txMasterBMedia.is-center > img,
html body #shortfilmView .txMasterBMedia.is-center > video {
  transform: none !important;
}

/* One iOS-style chevron family, optically centred in the circular buttons. */
html body #shortfilmView .txMasterBArrow {
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  color: #d1d5da !important;
  line-height: 1 !important;
}

html body #shortfilmView .txMasterBArrow svg.ui3-ios-chevron {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html body #shortfilmView .txMasterBArrow.is-prev svg.ui3-ios-chevron,
html body #shortfilmView .txMasterBArrow.prev svg.ui3-ios-chevron {
  transform: translateX(-1px) rotate(180deg);
}

html body #shortfilmView .txMasterBArrow.is-next svg.ui3-ios-chevron,
html body #shortfilmView .txMasterBArrow.next svg.ui3-ios-chevron {
  transform: translateX(1px);
}

html body #shortfilmView .txMasterBPlay svg.ui3-play-icon {
  width: 13px;
  height: 13px;
  margin-left: 1px;
  fill: currentColor;
  stroke: none;
}

/* Four-column curated wall using the approved local poster set. */
html body #homeView #pearlCuratedGrid.ui3-curated-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px 12px !important;
  columns: unset !important;
}

html body #homeView #pearlCuratedGrid .ui3-curated-card {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 10px;
  background: #111316;
  text-align: left;
}

html body #homeView #pearlCuratedGrid .ui3-curated-card .communityMedia {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #07080a;
}

html body #homeView #pearlCuratedGrid .ui3-curated-card .communityPoster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html body #homeView #pearlCuratedGrid .ui3-curated-card .communityBody {
  position: static !important;
  padding: 9px 10px 10px !important;
  background: transparent !important;
}

html body #homeView #pearlCuratedGrid .ui3-curated-card .film-index,
html body #homeView #pearlCuratedGrid .ui3-curated-card .film-duration {
  position: absolute;
  z-index: 3;
  color: rgb(255 255 255 / 72%);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

html body #homeView #pearlCuratedGrid .ui3-curated-card .film-index {
  top: 8px;
  left: 8px;
}

html body #homeView #pearlCuratedGrid .ui3-curated-card .film-duration {
  right: 8px;
  bottom: 8px;
}

@media (max-width: 920px) {
  html body #homeView #pearlCuratedGrid.ui3-curated-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html body #homeView .pearl-count-option {
    width: 36px !important;
    min-width: 36px !important;
    min-height: 44px !important;
  }

  html body #homeView #pearlCuratedTitle {
    font-size: 28px !important;
  }
}

@media (max-width: 359px) {
  html body #siteHeader #mobileNavToggle {
    right: 8px !important;
    max-width: calc(100vw - 16px) !important;
  }
}
