/* H5 return controls share the player reference: a dark circle and centered chevron. */
:root {
  --md-back-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15.5 5-7 7 7 7'/%3E%3C/svg%3E");
}

:is(#md-shell, #md-feature-layer, #md-watch-header, #md-episode-dialog, #md-account-sheet) button[aria-label^="返回"],
body.md-app-ui .u-navbar__content__left:has(.uicon-arrow-left) {
  box-sizing: border-box;
  flex: 0 0 40px !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: 1px solid #ffffff28 !important;
  border-radius: 50% !important;
  background: var(--md-back-icon) center / 22px 22px no-repeat #1119 !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:is(#md-shell, #md-feature-layer, #md-watch-header, #md-episode-dialog, #md-account-sheet) button[aria-label^="返回"] > *,
body.md-app-ui .u-navbar__content__left:has(.uicon-arrow-left) > * {
  display: none !important;
}

:is(#md-shell, #md-feature-layer, #md-watch-header, #md-episode-dialog, #md-account-sheet) button[aria-label^="返回"]::before,
:is(#md-shell, #md-feature-layer, #md-watch-header, #md-episode-dialog, #md-account-sheet) button[aria-label^="返回"]::after {
  display: none !important;
}

:is(#md-shell, #md-feature-layer, #md-watch-header, #md-episode-dialog, #md-account-sheet) button[aria-label^="返回"]:focus-visible {
  outline: 2px solid #ffffffa6;
  outline-offset: 3px;
}

#md-shell .md-history-header > button { top: 4px; }

/* Membership uses a return arrow on mobile and a close control on desktop. */
@media (max-width: 767px) {
  #md-account-sheet.md-membership-sheet > section > header:not(.md-commerce-header) > button {
    box-sizing: border-box;
    top: calc(10px + env(safe-area-inset-top, 0px));
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 1px solid #ffffff28;
    border-radius: 50%;
    background: var(--md-back-icon) center / 22px 22px no-repeat #1119;
    color: transparent;
    font-size: 0;
    line-height: 0;
  }
  #md-account-sheet.md-membership-sheet > section > header:not(.md-commerce-header) > button > * { display: none !important; }
}
