.hexo-stories {
  --hs-size: 88px;
  --hs-gap: 20px;
  --hs-ring-start: #ffb34c;
  --hs-ring-end: #bd37e3;
  --hs-seen: #c5c9d2;
  --hs-surface: #fff;
  --hs-text: #222833;
  --hs-ring-width: 3px;
  --hs-progress-height: 3px;
  --hs-progress-gap: 4px;
  --hs-progress-track: #ffffff50;
  --hs-progress-fill: #fff;
  --hs-control-size: 36px;
  --hs-control-icon-size: 22px;
  --hs-control-color: #fff;
  --hs-control-bg: transparent;
  --hs-control-hover-bg: #ffffff1f;
  --hs-close-bg: #ffffff16;
  --hs-arrow-bg: #ffffff18;
  --hs-player-bg: #12141b;
}

.hexo-stories *,
.hs-dialog * {
  box-sizing: border-box;
}

.hexo-stories [hidden],
.hs-dialog [hidden] {
  display: none !important;
}

.hexo-stories .hs-list {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--hs-gap);
  padding: 6px 3px 10px;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.hexo-stories .hs-item {
  list-style: none;
  flex: 0 0 var(--hs-size);
  width: var(--hs-size);
  margin: 0;
  padding: 0;
}

.hexo-stories .hs-story {
  appearance: none;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--hs-text);
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  text-align: center;
  border-radius: 10px;
}

.hexo-stories .hs-ring {
  display: block;
  width: var(--hs-size);
  height: var(--hs-size);
  border-radius: 50%;
  padding: var(--hs-ring-width);
  background: linear-gradient(35deg, var(--hs-ring-start), #ed497f 48%, var(--hs-ring-end));
  transition: transform .18s ease;
}

.hexo-stories .hs-story:hover .hs-ring {
  transform: translateY(-2px);
}

.hexo-stories .hs-viewed .hs-ring {
  background: var(--hs-seen);
}

.hexo-stories .hs-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: var(--hs-ring-width) solid var(--hs-surface);
  border-radius: 50%;
  overflow: hidden;
  background: #20232d;
  color: #fff;
}

.hexo-stories .hs-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  border-radius: 50%;
}

.hexo-stories .hs-name {
  display: block;
  max-width: 100%;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hexo-stories .hs-list-status {
  font-size: 13px;
  margin: 8px 0;
  color: var(--hs-text);
}

.hexo-stories .hs-list-status:empty {
  display: none;
}

.hexo-stories .hs-story:focus-visible,
.hs-dialog button:focus-visible,
.hs-dialog a:focus-visible {
  outline: 2px solid #879dff;
  outline-offset: 4px;
}

.hs-dialog {
  --hs-media-fit: contain;
  --hs-progress-height: 3px;
  --hs-progress-gap: 4px;
  --hs-progress-track: #ffffff50;
  --hs-progress-fill: #fff;
  --hs-control-size: 36px;
  --hs-control-icon-size: 22px;
  --hs-control-color: #fff;
  --hs-control-bg: transparent;
  --hs-control-hover-bg: #ffffff1f;
  --hs-close-bg: #ffffff16;
  --hs-arrow-bg: #ffffff18;
  --hs-player-bg: #12141b;
  color-scheme: dark;
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 36px 24px;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: inherit;
  overflow: auto;
  overscroll-behavior: contain;
}

.hs-dialog::backdrop {
  background: rgba(9, 11, 16, .97);
}

.hs-dialog button {
  appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  box-shadow: none;
}

.hs-dialog button:disabled {
  opacity: .25;
  cursor: default;
}

.hs-dialog .hs-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 4vw, 72px);
  min-height: 100%;
}

.hs-dialog .hs-player-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.hs-dialog .hs-player {
  position: relative;
  height: min(780px, calc(100vh - 72px));
  height: min(780px, calc(100dvh - 72px));
  aspect-ratio: 9 / 16;
  max-width: calc(100vw - 160px);
  overflow: hidden;
  background: var(--hs-player-bg);
  border-radius: 16px;
  box-shadow: 0 24px 100px #0007;
  isolation: isolate;
}

.hs-dialog .hs-media {
  position: absolute;
  inset: 0;
}

.hs-dialog .hs-media img,
.hs-dialog .hs-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--hs-media-fit);
  border: 0;
  margin: 0;
  border-radius: 0;
}

.hs-dialog .hs-header {
  position: absolute;
  z-index: 4;
  inset: 0 0 auto;
  padding: 12px 12px 34px;
  background: linear-gradient(#000b, #0000);
  pointer-events: none;
  direction: rtl;
}

.hs-dialog .hs-progress {
  display: flex;
  width: 100%;
  gap: var(--hs-progress-gap);
  height: var(--hs-progress-height);
  margin-bottom: 14px;
}

.hs-dialog .hs-progress > span {
  flex: 1;
  background: var(--hs-progress-track);
  border-radius: 3px;
  overflow: hidden;
}

.hs-dialog .hs-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--hs-progress-fill);
  transform: scaleX(0);
  transform-origin: left center;
}

.hs-dialog .hs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.hs-dialog .hs-current-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(45deg, #fb9660, #9b49bf);
  overflow: hidden;
  border: 1px solid #ffffff60;
}

.hs-dialog .hs-current-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-dialog .hs-current-info {
  min-width: 0;
  flex: 1;
}

.hs-dialog .hs-current-title {
  display: block;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.5;
  text-align: start;
}

.hs-dialog .hs-counter {
  display: block;
  font-size: 10px;
  color: #ffffffa8;
  margin-top: 1px;
  text-align: right;
}

.hs-dialog button.hs-icon-button {
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  width: var(--hs-control-size) !important;
  min-width: var(--hs-control-size) !important;
  max-width: var(--hs-control-size) !important;
  height: var(--hs-control-size) !important;
  min-height: var(--hs-control-size) !important;
  max-height: var(--hs-control-size) !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--hs-control-bg) !important;
  color: var(--hs-control-color) !important;
  box-shadow: none !important;
  line-height: 1 !important;
  flex: 0 0 var(--hs-control-size) !important;
}

.hs-dialog button.hs-icon-button:hover {
  background: var(--hs-control-hover-bg) !important;
}

.hs-dialog button.hs-icon-button[hidden] {
  display: none !important;
}

.hs-dialog button.hs-icon-button svg {
  display: block;
  width: var(--hs-control-icon-size);
  height: var(--hs-control-icon-size);
  max-width: none;
  max-height: none;
  flex: 0 0 auto;
}

.hs-dialog button.hs-arrow {
  background: var(--hs-arrow-bg) !important;
}

.hs-dialog button.hs-close {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 10;
  background: var(--hs-close-bg) !important;
}

.hs-dialog .hs-player > button.hs-tap,
.hs-dialog .hs-player > button.hs-tap:hover,
.hs-dialog .hs-player > button.hs-tap:focus,
.hs-dialog .hs-player > button.hs-tap:active {
  appearance: none !important;
  position: absolute !important;
  top: 80px !important;
  bottom: 0 !important;
  width: 35% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  z-index: 2;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  text-shadow: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
  opacity: 1 !important;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.hs-dialog .hs-player > button.hs-tap::before,
.hs-dialog .hs-player > button.hs-tap::after {
  content: none !important;
  display: none !important;
}

.hs-dialog .hs-player > button.hs-tap-prev {
  left: 0 !important;
}

.hs-dialog .hs-player > button.hs-tap-next {
  right: 0 !important;
  width: 65% !important;
}

.hs-dialog .hs-footer {
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 65px 24px 26px;
  background: linear-gradient(#0000, #000b);
  pointer-events: none;
}

.hs-dialog .hs-caption {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.7;
  color: #fff;
  white-space: pre-line;
  overflow-wrap: anywhere;
  max-height: 30vh;
  overflow: auto;
  pointer-events: auto;
}

.hs-dialog .hs-caption:empty {
  display: none;
}

.hs-dialog .hs-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 11px 22px;
  border-radius: 30px;
  background: #fff;
  color: #171a22;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
  pointer-events: auto;
  overflow-wrap: anywhere;
}

.hs-dialog .hs-link:hover {
  background: #ededf0;
  color: #171a22;
}

.hs-dialog .hs-media-status {
  position: absolute;
  inset: 42% 28px auto;
  z-index: 5;
  color: #ffffffd0;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  pointer-events: none;
}

.rtl .hs-dialog .hs-media-status {
    direction: rtl;
}

.hs-dialog .hs-media-status:empty {
  display: none;
}

.hs-dialog .hs-neighbor {
  position: relative;
  width: 150px;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: #20232e;
  flex-shrink: 0;
  opacity: .45;
  transition: opacity .2s ease, transform .2s ease;
}

.hs-dialog .hs-neighbor:hover {
  opacity: .8;
  transform: scale(1.03);
}

.hs-dialog .hs-neighbor[hidden] {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}

.hs-dialog .hs-neighbor-picture {
  display: block;
  height: 100%;
  width: 100%;
}

.hs-dialog .hs-neighbor-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-dialog .hs-neighbor-title {
  display: block;
  position: absolute;
  inset: auto 0 0;
  padding: 35px 12px 15px;
  background: linear-gradient(#0000, #000b);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hs-dialog .hs-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1000px) {
  .hs-dialog .hs-neighbor,
  .hs-dialog .hs-neighbor[hidden] {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .hexo-stories {
    --hs-size: 74px;
    --hs-gap: 14px;
  }

  .hs-dialog {
    padding: 0;
    overflow: hidden;
  }

  .hs-dialog .hs-stage {
    gap: 0;
  }

  .hs-dialog .hs-player-group {
    width: 100%;
    justify-content: center;
  }

  .hs-dialog .hs-player {
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    width: 100%;
    border-radius: 0;
  }

  .hs-dialog button.hs-arrow {
    display: none !important;
  }

  .hs-dialog .hs-header {
    padding: max(12px, env(safe-area-inset-top)) 0 34px;
  }

  .hs-dialog .hs-progress {
    width: 100%;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .hs-dialog .hs-toolbar {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(56px, calc(env(safe-area-inset-right) + 56px));
  }

  .hs-dialog button.hs-close {
    top: max(30px, calc(env(safe-area-inset-top) + 18px));
    right: max(10px, env(safe-area-inset-right));
  }

  .hs-dialog .hs-footer {
    padding-bottom: max(26px, calc(env(safe-area-inset-bottom) + 16px));
  }

  .hs-dialog .hs-toolbar {
    gap: 7px;
  }

  .hs-dialog .hs-current-avatar {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hexo-stories .hs-ring,
  .hs-dialog .hs-neighbor {
    transition: none;
  }
}