/* SVG 暗色模式滤镜过渡 */
img[src$=".svg"] {
  transition: filter .25s ease;
}

/* 阅读进度侧轨 */
.reading-progress-rail {
  position: fixed;
  left: 10px;
  top: 0;
  height: 100vh;
  width: 28px;
  z-index: 9998;
  pointer-events: none;
  opacity: 1;
  transition: opacity .3s
}

.reading-progress-rail::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 5vh;
  bottom: 5vh;
  width: 2px;
  background: linear-gradient(to bottom, hsl(var(--thyuu--color-font, 220 10% 50%)/0) 0%, hsl(var(--thyuu--color-font, 220 10% 50%)/.12) 8%, hsl(var(--thyuu--color-font, 220 10% 50%)/.12) 92%, hsl(var(--thyuu--color-font, 220 10% 50%)/0) 100%);
  border-radius: 1px
}

.reading-progress-marker {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateY(-50%);
  will-change: top
}

/* 自己：无过渡，滚动时实时跟手 */
.reading-progress-marker.is-you {
  transition: none
}

/* 其他读者：有进度变化时平滑飘过去 */
.reading-progress-marker.is-reader {
  transition: top .6s cubic-bezier(.22, 1, .36, 1)
}

.reading-progress-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 2px var(--page-bg, #fff), 0 0 8px currentColor
}

.reading-progress-label {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-3px);
  transition: all .25s;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  cursor: default
}

.reading-progress-marker:hover .reading-progress-label,
.reading-progress-marker.show-label .reading-progress-label {
  opacity: 1;
  transform: translateX(0)
}

.reading-progress-marker.is-you .reading-progress-dot {
  background: #10b981;
  color: rgba(16, 185, 129, .5)
}

.reading-progress-marker.is-you .reading-progress-label {
  background: rgba(16, 185, 129, .1);
  color: #10b981
}

.reading-progress-marker.is-reader .reading-progress-dot {
  background: #60a5fa;
  color: rgba(96, 165, 250, .5)
}

.reading-progress-marker.is-reader .reading-progress-label {
  background: rgba(96, 165, 250, .1);
  color: #60a5fa
}

.reading-progress-marker.is-you .reading-progress-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  animation: rp-pulse 2.5s infinite ease-in-out;
  z-index: -1
}

@keyframes rp-pulse {
  0% {
    transform: scale(1);
    opacity: .5
  }

  50% {
    transform: scale(2.8);
    opacity: 0
  }

  100% {
    transform: scale(1);
    opacity: 0
  }
}

.color-scheme-dark .reading-progress-dot {
  box-shadow: 0 0 0 2px var(--page-bg, #111), 0 0 8px currentColor
}

.color-scheme-dark .reading-progress-rail::after {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .10) 8%, rgba(255, 255, 255, .10) 92%, rgba(255, 255, 255, 0) 100%)
}

.reading-progress-rail.is-hidden {
  opacity: 0
}

@media(max-width:768px) {
  .reading-progress-rail {
    left: 3px;
    width: 22px
  }

  .reading-progress-rail::after {
    left: 4px;
    width: 1.5px
  }

  .reading-progress-dot {
    width: 6px;
    height: 6px
  }

  .reading-progress-label {
    font-size: 10px;
    padding: 1px 5px
  }
}
