/* =============================================================
   文字选区 · 秋叶
   拖选文字时,每个字符从基线长出一枝:茎、两片侧叶、顶上一片枫叶。
   画布压在内容层之下,叶子像从字里长出来,又藏在字后面。
   ============================================================= */

.al-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* 长叶子时把原生选区压淡一点,别盖住画面 */
html.al-active ::selection {
  background: rgba(191, 58, 28, 0.1);
  color: var(--text-primary);
}

html.al-active[data-theme="dark"] ::selection {
  background: rgba(224, 129, 63, 0.16);
  color: var(--text-primary);
}

/* 页面里的小提示 */
.al-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  cursor: default;
  transition: color 0.3s ease;
}

.al-hint::before {
  content: '';
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  background: var(--accent);
  opacity: 0.55;
  /* 一片小枫叶剪影 */
  clip-path: polygon(
    50% 0%, 58% 18%, 76% 10%, 70% 30%, 92% 32%, 74% 48%,
    88% 64%, 64% 62%, 62% 84%, 50% 68%, 38% 84%, 36% 62%,
    12% 64%, 26% 48%, 8% 32%, 30% 30%, 24% 10%, 42% 18%
  );
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}

.al-hint:hover {
  color: var(--text-secondary);
}

.al-hint:hover::before {
  opacity: 1;
  transform: rotate(-12deg) scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
  .al-canvas { display: none; }
  .al-hint { display: none; }
}
