/*!
 * RareUI for 董海棠博客 — 组件样式
 * 由 rareui.com 的 23 个组件移植而来（React → 原生）。
 * Credit: component designs recreated from Rare UI (https://www.rareui.com)
 *         MIT with Commons Clause + attribution requirement.
 */


/* ================= matrix-orb ================= */

/* ==== matrix-orb ==== */
.ru-matrix-orb {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
  user-select: none;
}
.ru-matrix-orb-canvas {
  display: block;
  image-rendering: auto;
}
.ru-matrix-orb-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--haitang-text-muted, #8E8472);
  transition: opacity 0.25s ease;
}
html[data-theme="dark"] .ru-matrix-orb-label {
  color: var(--haitang-text-muted, #847A66);
}
@media (prefers-reduced-motion: reduce) {
  .ru-matrix-orb-label { transition: none; }
}


/* ================= fluid-orb ================= */

/* ==== fluid-orb ==== */
.ru-fluid-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ru-fluid-orb-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
}

.ru-fluid-orb-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* 无 WebGL 时的兜底：径向渐变球，观感贴近 shader 的白顶 + 主色底 */
.ru-fluid-orb-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-color: var(--ru-fluid-orb-c, var(--haitang-accent, #C18A4A));
  background-image: radial-gradient(circle at 50% 26%,
    #FFFFFF 0%,
    rgba(255, 255, 255, 0.72) 34%,
    rgba(255, 255, 255, 0) 70%);
  box-shadow: inset 0 -10px 22px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .ru-fluid-orb-fallback {
  background-image: radial-gradient(circle at 50% 26%,
    #FFFFFF 0%,
    rgba(255, 255, 255, 0.62) 34%,
    rgba(255, 255, 255, 0) 72%);
}


/* ================= grid-reveal ================= */

/* ==== grid-reveal ==== */
.ru-grid-reveal {
  display: block;
  width: 100%;
}

.ru-grid-reveal-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--haitang-radius-lg, 16px);
  background: var(--haitang-card, #FFFCF5);
  border: 1px solid var(--haitang-border, rgba(74, 56, 32, 0.1));
  isolation: isolate;
}

.ru-grid-reveal-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- 说明条 ---------- */
.ru-grid-reveal-caption {
  pointer-events: none;
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 1;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.ru-grid-reveal-caption-text {
  display: block;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
  background-image: linear-gradient(90deg,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(255, 255, 255, 0.98) 50%,
    rgba(255, 255, 255, 0.5) 60%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ru-grid-reveal-shimmer 2.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes ru-grid-reveal-shimmer {
  0%   { background-position: 105% 0%; }
  76%  { background-position: -5% 0%; }
  100% { background-position: -5% 0%; }
}

/* 揭示完成后说明条淡出 */
.ru-grid-reveal-done .ru-grid-reveal-caption {
  opacity: 0;
}

html[data-theme="dark"] .ru-grid-reveal-frame {
  background: var(--haitang-card, #1C1915);
  border-color: var(--haitang-border, rgba(255, 255, 255, 0.08));
}

@media (prefers-reduced-motion: reduce) {
  .ru-grid-reveal-caption {
    transition: none;
  }
  .ru-grid-reveal-caption-text {
    background-image: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: rgba(255, 255, 255, 0.75);
    animation: none;
  }
}


/* ================= gravity-letters ================= */

/* ==== gravity-letters ==== */
.ru-gravity-letters {
  position: relative;
  display: block;
  width: 100%;
  min-height: 160px;
  overflow: hidden;
  border-radius: var(--haitang-radius-md, 12px);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
}

/* 覆盖层：原有子节点留在下方作背景 */
.ru-gravity-letters-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ru-gravity-letters-glyph {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 1;
  font-weight: 600;
  will-change: transform;
  color: var(--haitang-accent, #C18A4A);
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ru-gravity-letters-glyph-inner {
  display: inline-block;
  transform-origin: bottom center;
}

.ru-gravity-letters-leaving {
  opacity: 0;
}

html[data-theme="dark"] .ru-gravity-letters-glyph {
  color: var(--haitang-accent, #D8A768);
}

@media (prefers-reduced-motion: reduce) {
  .ru-gravity-letters-glyph {
    transition: none;
  }
}


/* ================= animated-counter ================= */

/* ==== animated-counter ==== */
.ru-animated-counter {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  color: var(--haitang-text, #2A2620);
}

/* 无障碍文本：视觉隐藏但可被读屏 */
.ru-animated-counter-sr {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ru-animated-counter-view {
  display: inline-flex;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
}

.ru-animated-counter-fixed,
.ru-animated-counter-mark {
  display: inline-block;
}

/* 每一位是一扇遮罩窗口，内部是 0-9 的滚轮 */
.ru-animated-counter-digit {
  position: relative;
  display: inline-grid;
  overflow: hidden;
  height: 1.5em;
  -webkit-mask-image: linear-gradient(to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.06) 5.5%,
    rgba(0, 0, 0, 0.5) 11%,
    rgba(0, 0, 0, 0.94) 16.5%,
    #000 22%,
    #000 78%,
    rgba(0, 0, 0, 0.94) 83.5%,
    rgba(0, 0, 0, 0.5) 89%,
    rgba(0, 0, 0, 0.06) 94.5%,
    rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.06) 5.5%,
    rgba(0, 0, 0, 0.5) 11%,
    rgba(0, 0, 0, 0.94) 16.5%,
    #000 22%,
    #000 78%,
    rgba(0, 0, 0, 0.94) 83.5%,
    rgba(0, 0, 0, 0.5) 89%,
    rgba(0, 0, 0, 0.06) 94.5%,
    rgba(0, 0, 0, 0) 100%);
}

/* 隐形的最宽脸，给没有等宽数字的字体定宽 */
.ru-animated-counter-sizer {
  visibility: hidden;
  grid-area: 1 / 1;
}

.ru-animated-counter-stack {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: block;
  will-change: transform;
}

.ru-animated-counter-face {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.5em;
}

html[data-theme="dark"] .ru-animated-counter {
  color: var(--haitang-text, #F3EDE1);
}

@media (prefers-reduced-motion: reduce) {
  .ru-animated-counter-stack {
    will-change: auto;
  }
}


/* ================= scroll-progress ================= */

/* ==== scroll-progress ==== */
.ru-scroll-progress {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
  color: var(--haitang-text, #2A2620);
}

.ru-scroll-progress-surface {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--haitang-card, #FFFCF5) 72%, transparent);
  border: 1px solid var(--haitang-border, rgba(74, 56, 32, 0.1));
  box-shadow: 0 10px 30px rgba(74, 56, 32, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  will-change: width, height, border-radius;
}

.ru-scroll-progress-pill,
.ru-scroll-progress-list {
  position: absolute;
  inset: 0;
  transition: opacity 0.24s cubic-bezier(0.65, 0, 0.35, 1), filter 0.24s cubic-bezier(0.65, 0, 0.35, 1);
}
.ru-scroll-progress-list { opacity: 0; pointer-events: none; filter: blur(4px); }
.ru-scroll-progress-surface.is-open .ru-scroll-progress-list { opacity: 1; pointer-events: auto; filter: blur(0); }
.ru-scroll-progress-surface.is-open .ru-scroll-progress-pill { opacity: 0; pointer-events: none; filter: blur(4px); }

/* 收起态胶囊 */
.ru-scroll-progress-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.ru-scroll-progress-ring { display: inline-flex; flex: 0 0 auto; width: 20px; height: 20px; }
.ru-scroll-progress-ring svg { transform: rotate(-90deg); display: block; }
.ru-scroll-progress-track { stroke: var(--haitang-border, rgba(74, 56, 32, 0.15)); }
.ru-scroll-progress-arc { stroke: var(--ru-sp-accent, var(--haitang-accent, #C18A4A)); }

.ru-scroll-progress-labelwrap { position: relative; display: block; height: 20px; flex: 0 0 auto; }
.ru-scroll-progress-label {
  position: absolute;
  inset: 0 0 0 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), filter 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.ru-scroll-progress-label.is-out { opacity: 0; filter: blur(1.5px); }

/* 展开态列表 */
.ru-scroll-progress-ul { list-style: none; margin: 0; padding: 6px; }
.ru-scroll-progress-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--haitang-text-muted, #8E8472);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.ru-scroll-progress-item:hover { color: var(--haitang-text, #2A2620); }
.ru-scroll-progress-item.is-active {
  color: var(--haitang-text, #2A2620);
  background: color-mix(in srgb, var(--haitang-text, #2A2620) 9%, transparent);
}
.ru-scroll-progress-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--haitang-text, #2A2620) 30%, transparent);
  transition: background-color 0.2s ease;
}
.ru-scroll-progress-item.is-active .ru-scroll-progress-dot { background: var(--haitang-text, #2A2620); }
.ru-scroll-progress-itemlabel { white-space: nowrap; position: relative; }

/* 离屏测量块 */
.ru-scroll-progress-measure {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}
.ru-scroll-progress-pillc { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px; }
.ru-scroll-progress-listc { display: inline-flex; flex-direction: column; padding: 6px; }
.ru-scroll-progress-itemc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}
.ru-scroll-progress-itemc .ru-scroll-progress-itemlabel { white-space: nowrap; }

html[data-theme="dark"] .ru-scroll-progress-surface {
  background: color-mix(in srgb, var(--haitang-card, #1E1B16) 72%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .ru-scroll-progress-item.is-active {
  background: color-mix(in srgb, var(--haitang-text, #F2ECE1) 14%, transparent);
}
html[data-theme="dark"] .ru-scroll-progress-dot {
  background: color-mix(in srgb, var(--haitang-text, #F2ECE1) 34%, transparent);
}
html[data-theme="dark"] .ru-scroll-progress-item.is-active .ru-scroll-progress-dot { background: var(--haitang-text, #F2ECE1); }

@media (prefers-reduced-motion: reduce) {
  .ru-scroll-progress-surface,
  .ru-scroll-progress-pill,
  .ru-scroll-progress-list,
  .ru-scroll-progress-label,
  .ru-scroll-progress-item,
  .ru-scroll-progress-dot { transition: none; }
}


/* ================= gooey-nav ================= */

/* ==== gooey-nav ==== */
.ru-gooey-nav {
  display: inline-block;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
}
.ru-gooey-nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ru-gooey-nav-seg {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--haitang-card, #FFFCF5);
  transition: border-radius 0.4s cubic-bezier(0.34, 1.28, 0.64, 1),
    background-color 0.4s cubic-bezier(0.34, 1.28, 0.64, 1);
}
/* 凹曲线颈部：绝对定位在缝隙里，向左右邻居填色 */
.ru-gooey-nav-neck {
  position: absolute;
  top: 0;
  right: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.ru-gooey-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  white-space: nowrap;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 500;
  color: var(--haitang-text-muted, #868593);
  text-decoration: none;
  cursor: pointer;
  transition: color 0s;
}
.ru-gooey-nav-seg[data-active="true"] .ru-gooey-nav-item {
  color: var(--ru-gooey-active-label, #FFFFFF);
  transition: color 0.4s ease;
}

/* 尺寸变体 */
.ru-gooey-nav[data-size="xs"] .ru-gooey-nav-item { gap: 4px; padding: 6px 8px; font-size: 11px; line-height: 16px; }
.ru-gooey-nav[data-size="sm"] .ru-gooey-nav-item { gap: 6px; padding: 8px 14px; font-size: 12px; line-height: 16px; }
.ru-gooey-nav[data-size="md"] .ru-gooey-nav-item { gap: 8px; padding: 10px 20px; font-size: 14px; line-height: 20px; }
.ru-gooey-nav[data-size="lg"] .ru-gooey-nav-item { gap: 10px; padding: 12px 24px; font-size: 16px; line-height: 24px; }

html[data-theme="dark"] .ru-gooey-nav-seg { background: var(--haitang-card, #262626); }
html[data-theme="dark"] .ru-gooey-nav-item { color: var(--haitang-text-muted, #A7A093); }

@media (prefers-reduced-motion: reduce) {
  .ru-gooey-nav-seg,
  .ru-gooey-nav-item { transition: none; }
}


/* ================= rail-toc ================= */

/* 停靠容器：高度 = 内容区高度（页尾之上），导轨 sticky 在其中滚动，
   到容器底部即被顶住停住，不会再跟随滚进页尾 */
.ru-rail-park {
  position: absolute;
  top: 0;
  right: 24px;
  width: max-content;
  pointer-events: none;
  z-index: 40;
}

/* ==== rail-toc ==== */
.ru-rail-toc {
  position: sticky;
  bottom: 16vh;
  pointer-events: auto;
  width: max-content;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
  color: var(--haitang-text, #2A2620);
  font-size: 14px;
}
.ru-rail-toc[data-side="left"] { margin-right: auto; margin-left: 0; }

.ru-rail-toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-weight: 500;
  color: color-mix(in srgb, var(--haitang-text, #2A2620) 70%, transparent);
}
.ru-rail-toc-title svg { width: 14px; height: 14px; margin-left: -2px; flex: 0 0 auto; }

.ru-rail-toc-list { position: relative; list-style: none; margin: 0; padding: 0; }

.ru-rail-toc-svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}
.ru-rail-toc-dash { stroke: color-mix(in srgb, var(--haitang-text, #2A2620) 25%, transparent); }
.ru-rail-toc-fill { stroke: var(--ru-rail-accent, var(--haitang-accent, #C18A4A)); }
.ru-rail-toc-dot {
  fill: transparent;
  stroke: color-mix(in srgb, var(--haitang-text, #2A2620) 35%, transparent);
  transition: fill 0.2s ease, stroke 0.2s ease;
}
/* h2：大标签圈；h3：小圈（r 由 JS 按 data-depth 设置） */
.ru-rail-toc-dot[data-depth="0"] { stroke-width: 1.5; }
.ru-rail-toc-dot[data-on="true"] {
  fill: var(--ru-rail-accent, var(--haitang-accent, #C18A4A));
  stroke: var(--ru-rail-accent, var(--haitang-accent, #C18A4A));
}

.ru-rail-toc-plane {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  color: var(--ru-rail-accent, var(--haitang-accent, #C18A4A));
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.35));
  will-change: transform;
}
.ru-rail-toc-plane svg { width: 16px; height: 16px; overflow: visible; }

.ru-rail-toc-item {
  display: block;
  width: 100%;
  padding: 6px 8px 6px 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--haitang-text, #2A2620) 50%, transparent);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.ru-rail-toc-item:hover { color: color-mix(in srgb, var(--haitang-text, #2A2620) 80%, transparent); }
.ru-rail-toc-item.is-active { font-weight: 500; color: var(--haitang-text, #2A2620); }

html[data-theme="dark"] .ru-rail-toc-fill,
html[data-theme="dark"] .ru-rail-toc-plane { color: var(--ru-rail-accent, var(--haitang-accent, #E0A868)); }

@media (max-width: 1100px) {
  .ru-rail-park, .ru-rail-toc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ru-rail-toc-item,
  .ru-rail-toc-dot { transition: none; }
}


/* ================= bounce-sidebar ================= */

/* ==== bounce-sidebar ==== */
.ru-bounce-sidebar {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding-left: 24px;
  list-style: none;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
}
.ru-bounce-sidebar[data-side="right"] { left: auto; right: 24px; }

.ru-bounce-sidebar-dot {
  position: absolute;
  left: 8px;
  top: 0;
  border-radius: 50%;
  background: var(--ru-bounce-dot, var(--haitang-accent, #C18A4A));
  opacity: 0;
  transition: opacity 0.15s ease;
  will-change: transform;
  pointer-events: none;
}
.ru-bounce-sidebar-dot.is-ready { opacity: 1; }

.ru-bounce-sidebar-heading {
  padding: 28px 4px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ru-bounce-dot, var(--haitang-accent, #C18A4A));
}
.ru-bounce-sidebar-heading:first-child { padding-top: 0; }

.ru-bounce-sidebar-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--haitang-text, #2A2620) 50%, transparent);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.ru-bounce-sidebar-item:hover { color: color-mix(in srgb, var(--haitang-text, #2A2620) 80%, transparent); }
.ru-bounce-sidebar-item[data-active="true"] { color: var(--haitang-text, #2A2620); }

@media (max-width: 1100px) {
  .ru-bounce-sidebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ru-bounce-sidebar-item,
  .ru-bounce-sidebar-dot { transition: none; }
}


/* ================= hook-sidebar ================= */

/* ==== hook-sidebar ==== */
.ru-hook-sidebar {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
  color: var(--haitang-text, #2A2620);
}
.ru-hook-sidebar[data-side="right"] { left: auto; right: 24px; }

.ru-hook-sidebar-label {
  padding: 0 8px 12px 2px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--haitang-text, #2A2620);
}

.ru-hook-sidebar-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ru-hook-sidebar-rail {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ru-hook-sidebar-rail.is-visible { opacity: 1; }
.ru-hook-sidebar-rail.is-hover { color: color-mix(in srgb, var(--haitang-text, #2A2620) 30%, transparent); }
.ru-hook-sidebar-rail.is-active { color: var(--ru-hook-accent, var(--haitang-accent, #C18A4A)); }

.ru-hook-sidebar-line {
  position: absolute;
  left: 2px;
  width: 1px;
  background: currentColor;
}
.ru-hook-sidebar.is-dashed .ru-hook-sidebar-line {
  background: repeating-linear-gradient(to top, transparent 0 2px, currentColor 2px 4px);
}

.ru-hook-sidebar-corner {
  position: absolute;
  left: 2px;
  display: block;
  width: 12px;
  height: 7px;
  line-height: 0;
}
.ru-hook-sidebar-corner svg { display: block; }
.ru-hook-sidebar.is-dashed .ru-hook-sidebar-corner path { stroke-dasharray: 2 2; }

.ru-hook-sidebar-item {
  display: block;
  width: 100%;
  padding: 6px 8px 6px 20px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--haitang-text, #2A2620) 50%, transparent);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.ru-hook-sidebar-item:hover { color: color-mix(in srgb, var(--haitang-text, #2A2620) 80%, transparent); }
.ru-hook-sidebar-item[data-active="true"] { color: var(--haitang-text, #2A2620); }

@media (max-width: 1100px) {
  .ru-hook-sidebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ru-hook-sidebar-rail,
  .ru-hook-sidebar-item { transition: none; }
}


/* ================= proximity-sidebar ================= */

/* ==== proximity-sidebar ==== */
.ru-proximity-sidebar {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
}
.ru-proximity-sidebar[data-side="right"] { left: auto; right: 0; justify-content: flex-end; }

.ru-proximity-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 32px;
  align-items: flex-start;
}
.ru-proximity-sidebar[data-side="right"] .ru-proximity-sidebar-inner { align-items: flex-end; }

.ru-proximity-sidebar-dash {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 110px;
  height: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
}
.ru-proximity-sidebar[data-side="right"] .ru-proximity-sidebar-dash { justify-content: flex-end; }
/* 扩大可点击 / 可悬停区域 */
.ru-proximity-sidebar-dash::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -7px;
  bottom: -7px;
}

.ru-proximity-sidebar-bar {
  display: block;
  width: 110px;
  transform-origin: left center;
  will-change: transform;
  transition: background-color 0.15s ease-out;
}
.ru-proximity-sidebar[data-side="right"] .ru-proximity-sidebar-bar { transform-origin: right center; }

.ru-proximity-sidebar-dash[data-tone="strong"] .ru-proximity-sidebar-bar {
  background: var(--haitang-text, #2A2620);
}
.ru-proximity-sidebar-dash[data-tone="muted"] .ru-proximity-sidebar-bar {
  background: color-mix(in srgb, var(--haitang-text, #2A2620) 40%, transparent);
}
.ru-proximity-sidebar-dash.is-active .ru-proximity-sidebar-bar {
  background: var(--ru-prox-accent, var(--haitang-accent, #C18A4A));
}

@media (max-width: 1100px) {
  .ru-proximity-sidebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ru-proximity-sidebar-bar { transition: none; }
}


/* ================= code-block ================= */

/* ==== code-block ==== */
.ru-code-block {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--haitang-font-body, "Inter", -apple-system, "Segoe UI", sans-serif);
  color: var(--cb-plain, var(--haitang-text, #2A2620));
}

.ru-code-block-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--cb-border, var(--haitang-border, rgba(74, 56, 32, .1)));
  border-radius: var(--haitang-radius-md, 12px);
  background: var(--cb-bg, #FBF8F1);
}

.ru-code-block-frame-flat {
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* ---------- header ---------- */
.ru-code-block-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  flex-shrink: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--cb-border, var(--haitang-border, rgba(74, 56, 32, .1)));
  background: var(--cb-header-bg, rgba(74, 56, 32, .035));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.ru-code-block-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--haitang-font-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  font-size: 12px;
  color: var(--cb-muted, var(--haitang-text-muted, #8E8472));
}

/* ---------- copy button ---------- */
.ru-code-block-copy {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cb-gutter, var(--haitang-text-muted, #8E8472));
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease-out, color .15s ease-out, transform .18s cubic-bezier(.34, 1.56, .64, 1);
}

.ru-code-block-copy:hover {
  background: var(--cb-hover-wash, rgba(74, 56, 32, .06));
  color: var(--cb-plain, var(--haitang-text, #2A2620));
}

.ru-code-block-copy:active { transform: scale(.9); }

.ru-code-block-copy[data-copied] {
  color: var(--cb-accent, var(--haitang-accent, #C18A4A));
  background: color-mix(in srgb, var(--cb-accent, #C18A4A) 12%, transparent);
}

.ru-code-block-copy-float {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border: 1px solid var(--cb-border, rgba(74, 56, 32, .1));
  background: var(--cb-float-bg, rgba(255, 255, 255, .75));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.ru-code-block-ico-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
}

.ru-code-block-ico {
  position: absolute;
  inset: 0;
  width: 14px;
  height: 14px;
  transition: opacity .2s ease, transform .2s ease, filter .2s ease;
}

.ru-code-block-ico-check {
  opacity: 0;
  transform: scale(.5);
  filter: blur(4px);
  stroke-dasharray: 24;
  stroke-dashoffset: 0;
}

.ru-code-block-copy[data-copied] .ru-code-block-ico:not(.ru-code-block-ico-check) {
  opacity: 0;
  transform: scale(.5);
  filter: blur(4px);
}

.ru-code-block-copy[data-copied] .ru-code-block-ico-check {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* ---------- code area ---------- */
.ru-code-block-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 0;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--cb-border, rgba(74, 56, 32, .1)) transparent;
}

.ru-code-block-frame-flat .ru-code-block-viewport { padding: 0; }

.ru-code-block-viewport:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cb-accent, #C18A4A) 40%, transparent);
}

.ru-code-block-viewport::-webkit-scrollbar { width: 8px; height: 8px; }
.ru-code-block-viewport::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: var(--cb-border, rgba(74, 56, 32, .12));
}

.ru-code-block ::selection { background: var(--cb-selection, rgba(193, 138, 74, .3)); }

.ru-code-block-pre {
  width: max-content;
  min-width: 100%;
  margin: 0;
  font-family: var(--haitang-font-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  font-size: 13px;
  line-height: 24px;
  tab-size: 4;
}

.ru-code-block-line {
  display: flex;
  min-width: 100%;
  padding: 0 14px;
}

.ru-code-block-frame-flat .ru-code-block-line { padding: 0; }

.ru-code-block-line-hl { background: var(--cb-line-wash, rgba(193, 138, 74, .1)); }

.ru-code-block-gutter {
  flex-shrink: 0;
  margin-right: 16px;
  text-align: right;
  color: var(--cb-gutter, var(--haitang-text-muted, #8E8472));
  -webkit-user-select: none;
  user-select: none;
}

.ru-code-block-text { padding-right: 14px; white-space: pre; }
.ru-code-block-frame-flat .ru-code-block-text { padding-right: 0; }

.ru-code-block-tok-comment { color: var(--cb-tok-comment, #8E8472); font-style: italic; }
.ru-code-block-tok-punct { color: var(--cb-tok-punct, #8E8472); }
.ru-code-block-tok-keyword { color: var(--cb-tok-keyword, var(--haitang-accent, #C18A4A)); }
.ru-code-block-tok-string { color: var(--cb-tok-string, #7C9A5B); }
.ru-code-block-tok-number { color: var(--cb-tok-number, #B07A3C); }
.ru-code-block-tok-class { color: var(--cb-tok-class, #C18A4A); }

/* ---------- 暗色 ---------- */
html[data-theme="dark"] .ru-code-block-frame { background: var(--cb-bg, #1B1A18); }
html[data-theme="dark"] .ru-code-block-header { background: var(--cb-header-bg, rgba(255, 255, 255, .03)); }
html[data-theme="dark"] .ru-code-block-name { color: var(--cb-muted, rgba(255, 255, 255, .6)); }

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ru-code-block-copy,
  .ru-code-block-ico { transition: none; }
}


/* ================= faq ================= */

/* ==== faq ==== */
.ru-faq {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 36rem;
  font-family: var(--haitang-font-body, "Inter", -apple-system, "Segoe UI", sans-serif);
}

.ru-faq-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- question bubble ---------- */
.ru-faq-question {
  align-self: flex-start;
  max-width: 85%;
  padding: 10px 16px;
  border: 0;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  text-align: left;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--haitang-text, #2A2620);
  background: var(--haitang-surface, #F4F4F9);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transform-origin: left bottom;
  transition: background-color .2s ease, color .2s ease, transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}

.ru-faq-question:active { transform: scale(.97); }

.ru-faq-question:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--faq-accent, #C18A4A) 55%, transparent);
  outline-offset: 2px;
}

.ru-faq-item-open .ru-faq-question {
  background: var(--haitang-card, #FFFCF5);
  color: var(--haitang-text, #2A2620);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

/* ---------- answer panel ---------- */
.ru-faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .42s cubic-bezier(.22, 1, .36, 1), opacity .24s ease;
}

.ru-faq-item-open .ru-faq-panel {
  grid-template-rows: 1fr;
  opacity: 1;
}

.ru-faq-panel-inner {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  transform-origin: right bottom;
  transform: translateY(12px) scale(.6);
  transition: transform .42s cubic-bezier(.34, 1.46, .64, 1);
}

.ru-faq-item-open .ru-faq-panel-inner {
  transform: translateY(0) scale(1);
}

.ru-faq-bubble {
  max-width: 85%;
  padding: 10px 16px;
  border-radius: 18px;
  border-bottom-right-radius: 6px;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -.01em;
  color: #fff;
  background: var(--faq-accent, var(--haitang-accent, #C18A4A));
  word-break: break-word;
}

.ru-faq-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  color: var(--faq-accent, var(--haitang-accent, #C18A4A));
  background: color-mix(in srgb, var(--haitang-card, #FFFCF5) 70%, transparent);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .15);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.ru-faq-mark { width: 20px; height: 20px; }

/* ---------- 暗色 ---------- */
html[data-theme="dark"] .ru-faq-question { background: var(--haitang-surface, #262626); color: var(--haitang-text, #EDE7DA); }
html[data-theme="dark"] .ru-faq-item-open .ru-faq-question { background: var(--haitang-card, #333333); box-shadow: none; }
html[data-theme="dark"] .ru-faq-avatar { background: rgba(255, 255, 255, .07); }

/* ---------- 减弱动效 ---------- */
.ru-faq-reduced .ru-faq-question,
.ru-faq-reduced .ru-faq-panel,
.ru-faq-reduced .ru-faq-panel-inner { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .ru-faq-question,
  .ru-faq-panel,
  .ru-faq-panel-inner { transition: none; }
  .ru-faq-panel-inner { transform: none; }
  .ru-faq-item-open .ru-faq-panel-inner { transform: none; }
}


/* ================= github-activity ================= */

/* ==== github-activity ==== */
.ru-github-activity {
  position: relative;
  display: block;
  max-width: 100%;
  padding: 16px;
  border: 1px solid var(--haitang-border, rgba(74, 56, 32, .1));
  border-radius: var(--haitang-radius-lg, 20px);
  background: var(--haitang-card, #FFFCF5);
  color: var(--haitang-text, #2A2620);
  font-family: var(--haitang-font-body, "Inter", -apple-system, "Segoe UI", sans-serif);
  --gh-cell: 13px;
  --gh-gap: 3px;
}

.ru-github-activity-heading {
  margin: 0 0 16px;
  padding: 0 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--haitang-text, #2A2620);
}

.ru-github-activity-months {
  display: flex;
  justify-content: center;
  gap: var(--gh-gap);
  margin-bottom: var(--gh-gap);
}

.ru-github-activity-month {
  width: var(--gh-cell);
  height: 12px;
  flex-shrink: 0;
  position: relative;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  color: var(--haitang-text-muted, #8E8472);
  opacity: .75;
}

.ru-github-activity-body {
  display: flex;
  justify-content: center;
  gap: var(--gh-gap);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--haitang-border, rgba(74, 56, 32, .12)) transparent;
}

.ru-github-activity-body::-webkit-scrollbar { height: 6px; }
.ru-github-activity-body::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: var(--haitang-border, rgba(74, 56, 32, .12));
}

.ru-github-activity-col {
  display: flex;
  flex-direction: column;
  gap: var(--gh-gap);
  flex-shrink: 0;
}

.ru-github-activity-cell {
  width: var(--gh-cell);
  height: var(--gh-cell);
  flex-shrink: 0;
  border-radius: 3px;
  background: color-mix(in srgb, var(--haitang-text, #2A2620) 8%, transparent);
  overflow: hidden;
  animation: ru-gh-pop .2s cubic-bezier(.22, 1, .36, 1) both;
}

.ru-github-activity-cell-in {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: var(--gh-accent, var(--haitang-accent, #C18A4A));
  transition: opacity .2s ease;
}

@keyframes ru-gh-pop {
  from { opacity: 0; transform: scale(.4); }
  to { opacity: 1; transform: scale(1); }
}

.ru-github-activity-tip {
  position: absolute;
  z-index: 20;
  padding: 4px 8px;
  border-radius: 8px;
  transform: translate(-50%, calc(-100% - 8px));
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  color: var(--haitang-card, #FFFCF5);
  background: var(--haitang-text, #2A2620);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5);
}

/* ---------- 暗色 ---------- */
html[data-theme="dark"] .ru-github-activity { background: var(--haitang-card, #1B1A18); }
html[data-theme="dark"] .ru-github-activity-cell { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .ru-github-activity-tip { color: #1B1A18; background: #EDE7DA; }

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ru-github-activity-cell { animation: none; }
}


/* ================= voice-note ================= */

/* ==== voice-note ==== */
.ru-voice-note {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  max-width: 100%;
  padding: 0 14px 0 6px;
  border-radius: 999px;
  color: var(--haitang-text, #2A2620);
  font-family: var(--haitang-font-body, "Inter", -apple-system, "Segoe UI", sans-serif);
  -webkit-user-select: none;
  user-select: none;
  --vn-accent: var(--haitang-accent, #C18A4A);
}

.ru-voice-note-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: 999px;
  background: var(--haitang-surface, #F4F4F9);
}

.ru-voice-note-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 170% at 6% 120%, var(--vn-accent) 0%, transparent 60%),
    radial-gradient(60% 160% at 42% 135%, var(--vn-accent) 0%, transparent 58%);
  filter: blur(16px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .3) 46%, rgba(0, 0, 0, .3) 54%, #000 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .3) 46%, rgba(0, 0, 0, .3) 54%, #000 100%);
  transition: opacity .5s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- play / pause ---------- */
.ru-voice-note-control {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--haitang-card, #FFFCF5);
  color: var(--haitang-text, #2A2620);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background-color .2s ease;
}

.ru-voice-note-control:active { transform: scale(.9); }
.ru-voice-note-control:focus-visible { outline: 2px solid color-mix(in srgb, var(--vn-accent) 60%, transparent); outline-offset: 2px; }

.ru-voice-note-control svg { width: 18px; height: 18px; }
.ru-voice-note-control path {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: d .28s cubic-bezier(.34, 1.2, .64, 1);
}

/* ---------- waveform ---------- */
.ru-voice-note-track {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  border-radius: 4px;
  outline: none;
}

.ru-voice-note-track-seekable { cursor: pointer; }
.ru-voice-note-track:focus-visible { outline: 2px solid color-mix(in srgb, var(--vn-accent) 60%, transparent); outline-offset: 2px; }

.ru-voice-note-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.ru-voice-note-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 999px;
  background: currentColor;
}

.ru-voice-note-bars-base { color: var(--haitang-text-muted, #8E8472); opacity: .55; }

.ru-voice-note-lit {
  position: absolute;
  inset: 0;
  clip-path: inset(0 100% 0 0);
}
.ru-voice-note-bars-lit { color: var(--vn-accent); }

/* ---------- time / speed ---------- */
.ru-voice-note-time {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--haitang-text-muted, #8E8472);
  cursor: pointer;
  outline: none;
}

.ru-voice-note-time:focus-visible { outline: 2px solid color-mix(in srgb, var(--vn-accent) 60%, transparent); outline-offset: 2px; border-radius: 999px; }

.ru-voice-note-speed {
  padding: 1px 4px;
  border-radius: 999px;
  font-size: .85em;
  line-height: 1;
  color: var(--haitang-text, #2A2620);
  background: color-mix(in srgb, var(--haitang-text, #2A2620) 12%, transparent);
}

/* ---------- 暗色 ---------- */
html[data-theme="dark"] .ru-voice-note-bg { background: var(--haitang-surface, #1C1C1C); }
html[data-theme="dark"] .ru-voice-note-control { background: #0E0E0E; color: #fff; }
html[data-theme="dark"] .ru-voice-note-speed { color: #fff; background: rgba(255, 255, 255, .15); }

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ru-voice-note-glow,
  .ru-voice-note-control { transition: none; }
  .ru-voice-note-control path { transition: none; }
}


/* ================= step-player ================= */

/* ==== step-player ==== */
.ru-step-player {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--haitang-text-muted, #8E8472);
  font-family: var(--haitang-font-body, "Inter", -apple-system, "Segoe UI", sans-serif);
  --sp-accent: var(--haitang-accent, #C18A4A);
}

.ru-step-player-rev { flex-direction: row-reverse; }

/* ---------- play 控制 ---------- */
.ru-step-player-control {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--haitang-surface, #F4F4F9);
  color: var(--haitang-text-muted, #8E8472);
  cursor: pointer;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background-color .2s ease;
}

.ru-step-player-control:active { transform: scale(.88); }
.ru-step-player-control:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }

.ru-step-player-control svg { display: block; }
.ru-step-player-control path {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: d .32s cubic-bezier(.34, 1.2, .64, 1), fill .2s ease, opacity .26s ease;
}

.ru-step-player-control[data-state="replay"] { color: var(--haitang-text, #2A2620); }

/* ---------- 步骤轨道 ---------- */
.ru-step-player-track {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
  border-radius: 999px;
  background: var(--haitang-surface, #F4F4F9);
}

.ru-step-player-step {
  position: relative;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--haitang-text-muted, #8E8472);
  overflow: hidden;
  transition: width .42s cubic-bezier(.34, 1.24, .64, 1), background-color .3s ease, transform .2s cubic-bezier(.34, 1.56, .64, 1);
}

.ru-step-player-step[data-state="past"] { background: var(--haitang-text, #3C3C43); }
.ru-step-player-step[data-state="active"] { background: color-mix(in srgb, var(--haitang-text-muted, #8E8472) 55%, transparent); }

.ru-step-player-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 999px;
  background: var(--haitang-text, #3C3C43);
}

.ru-step-player-hit {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ru-step-player-hit:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; border-radius: 999px; }

.ru-step-player-seekable .ru-step-player-step:hover { transform: scale(1.35); }
.ru-step-player-seekable .ru-step-player-step:active { transform: scale(.85); }

/* ---------- 暗色 ---------- */
html[data-theme="dark"] .ru-step-player-control,
html[data-theme="dark"] .ru-step-player-track { background: var(--haitang-surface, #262626); }
html[data-theme="dark"] .ru-step-player-step[data-state="past"],
html[data-theme="dark"] .ru-step-player-fill { background: #EBEBF5; }
html[data-theme="dark"] .ru-step-player-control[data-state="replay"] { color: #EBEBF5; }

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ru-step-player-control,
  .ru-step-player-step,
  .ru-step-player-control path { transition: none; }
}


/* ================= folder-component ================= */

/* ==== folder-component ==== */
.ru-folder-component {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--haitang-font-body, "Inter", -apple-system, "Segoe UI", sans-serif);
}

.ru-folder-scaler {
  position: relative;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ru-folder-scaler:focus-visible {
  outline: 2px solid var(--haitang-accent, #C18A4A);
  outline-offset: 6px;
  border-radius: 16px;
}

.ru-folder-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
}

.ru-folder-back {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ru-folder-cards {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
}

.ru-folder-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 164px;
  height: 214px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .22));
  transition: transform .55s cubic-bezier(.34, 1.28, .64, 1);
  will-change: transform;
}

.ru-folder-card svg { display: block; width: 100%; height: 100%; }

.ru-folder-flap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: bottom center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform .55s cubic-bezier(.34, 1.22, .64, 1);
  will-change: transform;
}

.ru-folder-glass {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transform: translateZ(0);
}

.ru-folder-flap-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---------- 减弱动效 ---------- */
.ru-folder-reduced .ru-folder-card,
.ru-folder-reduced .ru-folder-flap { transition-duration: .001s; }

@media (prefers-reduced-motion: reduce) {
  .ru-folder-card,
  .ru-folder-flap { transition-duration: .001s; }
}


/* ================= otp-input ================= */

/* ==== otp-input ==== */
.ru-otp-input {
  position: relative;
  display: inline-flex;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
  color: var(--haitang-text, #2A2620);
}

.ru-otp-input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.ru-otp-input-cell {
  position: relative;
  flex: none;
}

/* 真实输入框：文字透明，只负责接收键盘与光标焦点 */
.ru-otp-input-slot {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  text-align: center;
  font-family: inherit;
  font-weight: 600;
  font-size: var(--ru-otp-font, 18px);
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
  background: var(--haitang-card, #FFFCF5);
  border-radius: var(--ru-otp-radius, var(--haitang-radius-md, 12px));
  box-shadow: inset 0 0 0 1px var(--haitang-border, rgba(74, 56, 32, .1));
  transition: box-shadow .2s ease, background-color .2s ease;
}

.ru-otp-input-slot::selection { background: transparent; color: transparent; }
.ru-otp-input-slot::-moz-selection { background: transparent; color: transparent; }

.ru-otp-input-slot:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ru-otp-accent, var(--haitang-accent, #C18A4A));
}

.ru-otp-input[data-status="error"] .ru-otp-input-slot {
  box-shadow: inset 0 0 0 2px rgba(255, 59, 48, .7);
}

.ru-otp-input-slot:disabled {
  cursor: not-allowed;
  opacity: .5;
}

/* 字符层：居中、裁切，负责滚动 */
.ru-otp-input-charwrap {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--ru-otp-radius, var(--haitang-radius-md, 12px));
  pointer-events: none;
}

.ru-otp-input-char {
  display: block;
  font-weight: 600;
  font-size: var(--ru-otp-font, 18px);
  color: var(--haitang-text, #2A2620);
  will-change: transform;
  transition: transform .42s cubic-bezier(.34, 1.15, .42, 1), opacity .25s ease;
}

/* 成功描边 */
.ru-otp-input-ring {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 闪烁光标 */
.ru-otp-input-caret {
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: var(--ru-otp-caret-h, 24px);
  border-radius: 2px;
  background: var(--haitang-text, #2A2620);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s cubic-bezier(.34, 1.2, .42, 1);
  will-change: transform;
}

.ru-otp-input-caret--on {
  animation: ru-otp-input-blink 1.1s linear infinite;
}

@keyframes ru-otp-input-blink {
  0% { opacity: 1; }
  50% { opacity: 1; }
  50.01% { opacity: 0; }
  100% { opacity: 0; }
}

/* 错误抖动 */
.ru-otp-input-row--error {
  animation: ru-otp-input-shake .32s ease-out;
}

@keyframes ru-otp-input-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ru-otp-input-char { transition: none; }
  .ru-otp-input-caret { transition: none; }
  .ru-otp-input-caret--on { animation: none; opacity: 1; }
  .ru-otp-input-row--error { animation: none; }
}

/* 暗色 */
html[data-theme="dark"] .ru-otp-input-slot {
  background: var(--haitang-card, #262626);
  box-shadow: inset 0 0 0 1px var(--haitang-border, rgba(255, 255, 255, .08));
}

html[data-theme="dark"] .ru-otp-input-char {
  color: var(--haitang-text, #F3EEE4);
}

html[data-theme="dark"] .ru-otp-input-caret {
  background: var(--haitang-text, #F3EEE4);
}


/* ================= duration-picker ================= */

/* ==== duration-picker ==== */
.ru-duration-picker {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 48px;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
  color: var(--haitang-text, #2A2620);
  --ru-dp-gap-fallback: 0px;
}

.ru-duration-picker[data-disabled="1"] {
  opacity: .5;
  pointer-events: none;
}

.ru-duration-picker-seg {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
  background: var(--haitang-card, #FFFCF5);
  transition: background-color .2s ease;
}

.ru-duration-picker-seg--hours {
  padding-left: 8px;
  padding-right: var(--ru-dp-pr, 3px);
  border-radius: var(--haitang-radius-md, 12px) var(--ru-dp-ri, 0px) var(--ru-dp-ri, 0px) var(--haitang-radius-md, 12px);
}

.ru-duration-picker-seg--minutes {
  margin-left: var(--ru-dp-gap, 0px);
  padding-left: var(--ru-dp-pl, 0px);
  padding-right: var(--ru-dp-pr, 3px);
  border-radius: var(--ru-dp-ri, 0px);
}

.ru-duration-picker-seg--toggle {
  margin-left: var(--ru-dp-gap, 0px);
  border-radius: var(--ru-dp-ri, 0px) var(--haitang-radius-md, 12px) var(--haitang-radius-md, 12px) var(--ru-dp-ri, 0px);
}

/* 摇摆层（随缝隙速度轻微左右） */
.ru-duration-picker-sway {
  transform: translateX(var(--ru-dp-sway, 0px));
  will-change: transform;
}

.ru-duration-picker-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
}

.ru-duration-picker-input {
  height: 100%;
  text-align: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--haitang-text, #2A2620);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  transition: width .34s cubic-bezier(.34, 1.1, .42, 1), background-color .2s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.ru-duration-picker-input::-webkit-outer-spin-button,
.ru-duration-picker-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ru-duration-picker-input::placeholder {
  color: var(--haitang-text-muted, #8E8472);
}

.ru-duration-picker-input:focus-visible {
  box-shadow: 0 0 0 2px var(--ru-dp-accent, var(--haitang-accent, #C18A4A));
  border-radius: 6px;
}

.ru-duration-picker-measure {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  font-weight: 600;
  font-size: 15px;
  pointer-events: none;
}

.ru-duration-picker-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--haitang-text-muted, #8E8472);
  white-space: nowrap;
}

.ru-duration-picker-toggle {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--haitang-text-muted, #8E8472);
  transition: transform .2s ease, color .2s ease;
}

.ru-duration-picker-toggle:active {
  transform: scale(.9);
}

.ru-duration-picker-toggle:focus-visible {
  outline: 2px solid var(--ru-dp-accent, var(--haitang-accent, #C18A4A));
  outline-offset: -2px;
}

/* 笔 → 勾 的形变（两条路径交叉淡入淡出，勾线由 0 描到 2.5） */
.ru-duration-picker-ico-pen {
  opacity: 1;
  transition: opacity .3s ease;
}

.ru-duration-picker-ico-dash {
  stroke: var(--haitang-card, #FFFCF5);
  opacity: 1;
  transition: opacity .22s ease;
}

.ru-duration-picker-ico-tick {
  stroke-width: 0;
  opacity: 0;
  transition: stroke-width .32s ease, opacity .2s ease;
}

.ru-duration-picker.is-editing .ru-duration-picker-ico-pen { opacity: 0; }
.ru-duration-picker.is-editing .ru-duration-picker-ico-dash { opacity: 0; }
.ru-duration-picker.is-editing .ru-duration-picker-ico-tick { stroke-width: 2.5; opacity: 1; }

/* 越界抖动 */
.ru-duration-picker-shake {
  animation: ru-duration-picker-shake .5s cubic-bezier(.3, 1.4, .5, 1);
}

@keyframes ru-duration-picker-shake {
  0% { transform: translateX(6px); }
  60% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ru-duration-picker-input,
  .ru-duration-picker-sway,
  .ru-duration-picker-toggle,
  .ru-duration-picker-ico-pen,
  .ru-duration-picker-ico-dash,
  .ru-duration-picker-ico-tick {
    transition: none;
  }
  .ru-duration-picker-shake { animation: none; }
}

/* 暗色 */
html[data-theme="dark"] .ru-duration-picker-seg {
  background: var(--haitang-card, #262626);
}

html[data-theme="dark"] .ru-duration-picker-input {
  color: var(--haitang-text, #F3EEE4);
}

html[data-theme="dark"] .ru-duration-picker-ico-dash {
  stroke: var(--haitang-card, #262626);
}


/* ================= delete-button ================= */

/* ==== delete-button ==== */
.ru-delete-button {
  position: relative;
  height: 48px;
  width: 48px;
  border-radius: var(--haitang-radius-lg, 16px);
  background: var(--haitang-card, #FFFCF5);
  color: var(--haitang-text-muted, #8E8472);
  box-shadow: 0 .5px 1px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .08);
  transition: width .62s cubic-bezier(.32, .72, 0, 1), background-color .2s ease;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
}

.ru-delete-button[data-state="open"] { width: 132px; }

.ru-delete-button-trigger {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: var(--haitang-radius-lg, 16px);
  cursor: pointer;
  transition: transform .2s cubic-bezier(.32, .72, 0, 1);
}

.ru-delete-button-trigger:active { transform: scale(.94); }

.ru-delete-button-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ru-db-accent, var(--haitang-accent, #C18A4A));
}

.ru-delete-button-icon {
  position: absolute;
  overflow: visible;
  transition: opacity .22s cubic-bezier(.32, .72, 0, 1);
}

.ru-delete-button-check { opacity: 0; }

.ru-delete-button[data-status="deleted"] .ru-delete-button-check { opacity: 1; }
.ru-delete-button[data-status="deleted"] .ru-delete-button-bin { opacity: 0; }

/* 盖子绕左上铰链打开 */
.ru-delete-button-lid {
  transform-box: view-box;
  transform-origin: 3px 6px;
  transform: rotate(0deg);
  transition: transform .6s cubic-bezier(.34, 1.1, .64, 1);
}

.ru-delete-button[data-state="open"] .ru-delete-button-lid { transform: rotate(-35deg); }

/* 取消后的回弹 */
.ru-delete-button[data-status="kept"] .ru-delete-button-bin {
  animation: ru-delete-button-nudge .45s cubic-bezier(.32, .72, 0, 1);
}

@keyframes ru-delete-button-nudge {
  0% { transform: scale(1); }
  45% { transform: scale(.86); }
  100% { transform: scale(1); }
}

/* 展开面板 */
.ru-delete-button-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 84px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--haitang-radius-lg, 16px);
  background: rgba(74, 56, 32, .07);
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity .3s cubic-bezier(.32, .72, 0, 1), transform .3s cubic-bezier(.32, .72, 0, 1);
}

.ru-delete-button[data-state="open"] .ru-delete-button-panel {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition-duration: .44s;
  transition-delay: .14s;
}

.ru-delete-button-tail {
  position: absolute;
  left: -5px;
  top: 50%;
  z-index: 20;
  width: 6px;
  height: 10px;
  transform: translateY(-50%);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  background: rgba(74, 56, 32, .07);
}

.ru-delete-button-circle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--haitang-card, #FFFCF5);
  color: var(--haitang-text-muted, #8E8472);
  box-shadow: 0 .5px 1px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .08);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .44s cubic-bezier(.32, .72, 0, 1), transform .44s cubic-bezier(.32, .72, 0, 1), background-color .2s ease;
}

.ru-delete-button[data-state="open"] .ru-delete-button-circle {
  opacity: 1;
  transform: scale(1);
  transition-delay: .14s;
}

.ru-delete-button[data-state="open"] .ru-delete-button-circle:nth-of-type(2) { transition-delay: .21s; }

.ru-delete-button-circle:hover { background: rgba(74, 56, 32, .05); }
.ru-delete-button-circle:active { transform: scale(.84); }

.ru-delete-button-circle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ru-db-accent, var(--haitang-accent, #C18A4A));
}

.ru-delete-button-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .ru-delete-button,
  .ru-delete-button-lid,
  .ru-delete-button-panel,
  .ru-delete-button-circle,
  .ru-delete-button-trigger,
  .ru-delete-button-icon {
    transition: none;
  }
  .ru-delete-button[data-status="kept"] .ru-delete-button-bin { animation: none; }
}

/* 暗色 */
html[data-theme="dark"] .ru-delete-button {
  background: var(--haitang-card, #262626);
  color: var(--haitang-text-muted, #9B9AA7);
  box-shadow: 0 .5px 1px rgba(0, 0, 0, .35), 0 1.5px 4px rgba(0, 0, 0, .25);
}

html[data-theme="dark"] .ru-delete-button-panel,
html[data-theme="dark"] .ru-delete-button-tail {
  background: rgba(255, 255, 255, .06);
}

html[data-theme="dark"] .ru-delete-button-circle {
  background: var(--haitang-card, #2C2C2C);
  color: var(--haitang-text-muted, #9B9AA7);
  box-shadow: 0 .5px 1px rgba(0, 0, 0, .35), 0 1.5px 4px rgba(0, 0, 0, .25);
}

html[data-theme="dark"] .ru-delete-button-circle:hover { background: rgba(255, 255, 255, .1); }


/* ================= task-list ================= */

/* ==== task-list ==== */
.ru-task-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  max-width: 100%;
  gap: var(--ru-task-list-gap, 10px);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
}

.ru-task-list-row {
  max-width: 100%;
  will-change: transform;
}

.ru-task-list-item {
  display: flex;
  align-items: flex-start;
  width: fit-content;
  max-width: 100%;
  gap: var(--ru-task-list-gap, 10px);
  padding: var(--ru-task-list-pad, 10px 14px);
  border: none;
  border-radius: var(--ru-task-list-radius, 14px);
  text-align: left;
  cursor: pointer;
  background: var(--haitang-card, #FFFCF5);
  font-family: inherit;
  color: var(--haitang-text, #2A2620);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 3px 10px rgba(0, 0, 0, .06);
  transition: filter .3s ease, box-shadow .3s ease;
}

.ru-task-list-item:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 18px rgba(0, 0, 0, .09); }
.ru-task-list-item:active { filter: brightness(.95); }

.ru-task-list-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ru-task-list-accent, var(--haitang-accent, #C18A4A));
}

/* 勾选框 */
.ru-task-list-check {
  flex: none;
  width: var(--ru-task-list-check, 24px);
  height: var(--ru-task-list-check, 24px);
  color: rgba(74, 56, 32, .22);
  transform-origin: 50% 50%;
}

.ru-task-list-item.is-pop .ru-task-list-check {
  animation: ru-task-list-pop .34s cubic-bezier(.22, 1, .36, 1);
}

@keyframes ru-task-list-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.ru-task-list-ring {
  opacity: 1;
  transition: opacity .24s cubic-bezier(.22, 1, .36, 1);
}

.ru-task-list-item.is-filled .ru-task-list-ring { opacity: 0; }

.ru-task-list-fill {
  fill: var(--ru-task-list-accent, var(--haitang-accent, #C18A4A));
  transform-box: view-box;
  transform-origin: 12px 12px;
  transform: scale(0);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1);
}

.ru-task-list-item.is-filled .ru-task-list-fill { transform: scale(1); }

.ru-task-list-tick {
  stroke: #ffffff;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset .22s cubic-bezier(.22, 1, .36, 1) .06s, opacity .18s ease .06s;
}

.ru-task-list-item.is-filled .ru-task-list-tick { stroke-dashoffset: 0; opacity: 1; }

/* 文案与划线 */
.ru-task-list-label { min-width: 0; flex: 1 1 auto; }

.ru-task-list-text {
  font-size: var(--ru-task-list-font, 15px);
  line-height: 1.55;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--haitang-text, #2A2620);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 52%;
  background-size: 0% var(--ru-task-list-line, 2px);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size .38s cubic-bezier(.65, 0, .35, 1), color .3s ease;
}

.ru-task-list-item.is-struck .ru-task-list-text {
  background-size: 100% var(--ru-task-list-line, 2px);
  color: var(--haitang-text-muted, #8E8472);
}

/* 完成瞬间的横向抖动 */
.ru-task-list-item.is-nudge {
  animation: ru-task-list-nudge .3s cubic-bezier(.22, 1, .36, 1);
}

@keyframes ru-task-list-nudge {
  0% { transform: translateX(0); }
  35% { transform: translateX(8px); }
  70% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ru-task-list-ring,
  .ru-task-list-fill,
  .ru-task-list-tick,
  .ru-task-list-text,
  .ru-task-list-item,
  .ru-task-list-row {
    transition: none;
  }
  .ru-task-list-item.is-pop .ru-task-list-check,
  .ru-task-list-item.is-nudge {
    animation: none;
  }
}

/* 暗色 */
html[data-theme="dark"] .ru-task-list-item {
  background: var(--haitang-card, #1F1F1F);
  color: var(--haitang-text, #F3EEE4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 3px 10px rgba(0, 0, 0, .3);
}

html[data-theme="dark"] .ru-task-list-item:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 18px rgba(0, 0, 0, .4);
}

html[data-theme="dark"] .ru-task-list-item:active { filter: brightness(1.1); }

html[data-theme="dark"] .ru-task-list-check { color: rgba(255, 255, 255, .22); }

html[data-theme="dark"] .ru-task-list-text { color: var(--haitang-text, #F3EEE4); }


/* ================= emoji-reaction ================= */

/* ==== emoji-reaction ==== */
.ru-emoji-reaction {
  position: relative;
  display: flex;
  width: fit-content;
  align-items: center;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
}

/* 触发按钮 */
.ru-emoji-reaction-trigger {
  position: relative;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--haitang-card, #FFFCF5);
  color: var(--haitang-text-muted, #8E8472);
  box-shadow: 0 .5px 1px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .08);
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.ru-emoji-reaction-trigger:hover { color: var(--haitang-text, #2A2620); }
.ru-emoji-reaction-trigger:active { transform: scale(.92); }

.ru-emoji-reaction-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--haitang-accent, #C18A4A);
}

.ru-emoji-reaction-trigger-icon,
.ru-emoji-reaction-trigger-close,
.ru-emoji-reaction-trigger-last { display: none; }
.ru-emoji-reaction-trigger-icon { display: block; }

.ru-emoji-reaction.is-open .ru-emoji-reaction-trigger-icon { display: none; }
.ru-emoji-reaction.is-open .ru-emoji-reaction-trigger-close { display: block; }

.ru-emoji-reaction.has-last:not(.is-open) .ru-emoji-reaction-trigger-icon { display: none; }
.ru-emoji-reaction.has-last:not(.is-open) .ru-emoji-reaction-trigger-last {
  display: block;
  font-size: calc(var(--ru-er-emoji, 34px) * .72);
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* 弹出的反应条 */
.ru-emoji-reaction-pop {
  position: absolute;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.ru-emoji-reaction.is-open .ru-emoji-reaction-pop {
  opacity: 1;
  pointer-events: auto;
}

.ru-emoji-reaction-pop-inner {
  position: relative;
  transform: translateY(10px) scale(.85);
  opacity: 0;
  transition: transform .42s cubic-bezier(.34, 1.28, .5, 1), opacity .2s ease;
  transform-origin: 50% 100%;
}

.ru-emoji-reaction-pop--bottom .ru-emoji-reaction-pop-inner { transform-origin: 50% 0; }

.ru-emoji-reaction.is-open .ru-emoji-reaction-pop-inner {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ru-emoji-reaction-pop--bottom .ru-emoji-reaction-pop-inner { transform: translateY(-10px) scale(.85); }
.ru-emoji-reaction.is-open .ru-emoji-reaction-pop--bottom .ru-emoji-reaction-pop-inner { transform: translateY(0) scale(1); }

.ru-emoji-reaction-pill {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background: var(--haitang-card, #FFFCF5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .1);
}

.ru-emoji-reaction-item {
  position: relative;
  z-index: 10;
  padding: 4px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  font-size: var(--ru-er-emoji, 34px);
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  transition: transform .18s ease;
}

.ru-emoji-reaction.is-open .ru-emoji-reaction-item {
  animation: ru-emoji-reaction-item-in .5s cubic-bezier(.34, 1.4, .5, 1) backwards;
}

.ru-emoji-reaction.is-open .ru-emoji-reaction-item:hover { transform: scale(1.28) translateY(-4px); }
.ru-emoji-reaction.is-open .ru-emoji-reaction-item:active { transform: scale(.92); }

.ru-emoji-reaction-item:focus-visible {
  box-shadow: 0 0 0 2px var(--haitang-accent, #C18A4A);
}

@keyframes ru-emoji-reaction-item-in {
  0% { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 小尾巴 */
.ru-emoji-reaction-tail {
  position: absolute;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--haitang-card, #FFFCF5);
  z-index: 1;
}

.ru-emoji-reaction-tail--small {
  width: 6px;
  height: 6px;
  margin-left: -3px;
}

.ru-emoji-reaction-pop:not(.ru-emoji-reaction-pop--bottom) .ru-emoji-reaction-tail { bottom: -4px; }
.ru-emoji-reaction-pop:not(.ru-emoji-reaction-pop--bottom) .ru-emoji-reaction-tail--small { bottom: -16px; }
.ru-emoji-reaction-pop--bottom .ru-emoji-reaction-tail { top: -4px; }
.ru-emoji-reaction-pop--bottom .ru-emoji-reaction-tail--small { top: -16px; }

/* 粒子：向上扩散 + 漂移 + 旋转 + 缩放 + 模糊淡出 */
.ru-emoji-reaction-particle {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  line-height: 1;
  user-select: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  will-change: transform, opacity, filter;
  animation: ru-emoji-reaction-rise 1.5s cubic-bezier(.4, .3, .5, 1) forwards;
}

@keyframes ru-emoji-reaction-rise {
  0% {
    transform: translate3d(var(--x0, 0px), 0, 0) rotate(0deg) scale(.6);
    opacity: 0;
    filter: blur(0px);
  }
  3% { opacity: 1; }
  10% {
    transform: translate3d(calc(var(--x0, 0px) + var(--drift, 0px) * .12), calc(var(--travel, 0px) * -.12), 0)
      rotate(calc(var(--tilt, 0deg) * 1)) scale(var(--peak, 1));
  }
  22% {
    transform: translate3d(calc(var(--x0, 0px) + var(--drift, 0px) * .3), calc(var(--travel, 0px) * -.32), 0)
      rotate(calc(var(--tilt, 0deg) * .2)) scale(var(--scale, 1));
  }
  65% {
    transform: translate3d(calc(var(--x0, 0px) + var(--drift, 0px) * .72), calc(var(--travel, 0px) * -.78), 0)
      rotate(calc(var(--tilt, 0deg) * -.65)) scale(calc(var(--scale, 1) * .9));
    opacity: 1;
  }
  100% {
    transform: translate3d(calc(var(--x0, 0px) + var(--drift, 0px)), calc(var(--travel, 0px) * -1), 0)
      rotate(calc(var(--tilt, 0deg) * .35)) scale(calc(var(--scale, 1) * .75));
    opacity: 0;
    filter: blur(var(--blur, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ru-emoji-reaction-trigger,
  .ru-emoji-reaction-pop,
  .ru-emoji-reaction-pop-inner,
  .ru-emoji-reaction-item {
    transition: none;
  }
  .ru-emoji-reaction.is-open .ru-emoji-reaction-item { animation: none; }
  .ru-emoji-reaction-particle { animation: none; opacity: 0; }
}

/* 暗色 */
html[data-theme="dark"] .ru-emoji-reaction-trigger,
html[data-theme="dark"] .ru-emoji-reaction-pill,
html[data-theme="dark"] .ru-emoji-reaction-tail {
  background: var(--haitang-card, #262626);
}

html[data-theme="dark"] .ru-emoji-reaction-trigger { color: var(--haitang-text-muted, #9B9AA7); }
html[data-theme="dark"] .ru-emoji-reaction-trigger:hover { color: var(--haitang-text, #F3EEE4); }


/* ================= notification-bell ================= */

/* ==== notification-bell ==== */
.ru-notification-bell {
  position: relative;
  display: inline-block;
  font-family: var(--haitang-font-body, "Inter", sans-serif);
}

.ru-notification-bell-trigger {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--haitang-card, #FFFCF5);
  color: var(--haitang-text-muted, #8E8472);
  box-shadow: 0 .5px 1px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .08);
  transition: transform .2s ease, color .2s ease;
}

.ru-notification-bell-trigger:active { transform: scale(.9); }

.ru-notification-bell-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ru-nb-accent, var(--haitang-accent, #C18A4A));
}

.ru-notification-bell-svg {
  display: block;
  transform-origin: 50% 12%;
  will-change: transform;
}

.ru-notification-bell-clapper {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  will-change: transform;
}

.ru-notification-bell-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 徽标 */
.ru-notification-bell-badge {
  position: absolute;
  z-index: 10;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  transition: transform .38s cubic-bezier(.34, 1.4, .5, 1), opacity .2s ease;
}

.ru-notification-bell-badge.is-on {
  opacity: 1;
  transform: scale(1);
}

.ru-notification-bell-badge--red { background: #FF3B30; }
.ru-notification-bell-badge--orange { background: #FF9500; }
.ru-notification-bell-badge--green { background: #34C759; }
.ru-notification-bell-badge--blue { background: #007AFF; }
.ru-notification-bell-badge--violet { background: #AF52DE; }

.ru-notification-bell-digits {
  display: flex;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.ru-notification-bell-digit {
  position: relative;
  display: inline-block;
  height: 1em;
  width: 1ch;
  overflow: hidden;
}

.ru-notification-bell-digit-strip {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.ru-notification-bell-digit-tile {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

/* 展开面板 */
.ru-notification-bell-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 40;
  width: 300px;
  max-width: 90vw;
  padding: 8px;
  border-radius: var(--haitang-radius-md, 12px);
  background: var(--haitang-card, #FFFCF5);
  border: 1px solid var(--haitang-border, rgba(74, 56, 32, .1));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  transform-origin: 100% 0;
  opacity: 0;
  transform: translateY(-8px) scale(.96);
  pointer-events: none;
  transition: opacity .24s ease, transform .34s cubic-bezier(.34, 1.3, .5, 1);
}

.ru-notification-bell.is-open .ru-notification-bell-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ru-notification-bell-head {
  padding: 8px 10px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--haitang-text-muted, #8E8472);
}

.ru-notification-bell-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.ru-notification-bell-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 26px 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .18s ease;
}

.ru-notification-bell-item:hover { background: rgba(74, 56, 32, .05); }

.ru-notification-bell-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--haitang-text, #2A2620);
}

.ru-notification-bell-item-desc {
  font-size: 12px;
  color: var(--haitang-text-muted, #8E8472);
}

.ru-notification-bell-item-dot {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ru-nb-accent, var(--haitang-accent, #C18A4A));
  transition: opacity .2s ease, transform .2s ease;
}

.ru-notification-bell-item.is-read .ru-notification-bell-item-title { color: var(--haitang-text-muted, #8E8472); font-weight: 500; }
.ru-notification-bell-item.is-read .ru-notification-bell-item-dot { opacity: 0; transform: scale(.4); }

.ru-notification-bell-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--haitang-text-muted, #8E8472);
}

@media (prefers-reduced-motion: reduce) {
  .ru-notification-bell-trigger,
  .ru-notification-bell-badge,
  .ru-notification-bell-panel,
  .ru-notification-bell-item-dot {
    transition: none;
  }
}

/* 暗色 */
html[data-theme="dark"] .ru-notification-bell-trigger {
  background: var(--haitang-card, #262626);
  color: var(--haitang-text-muted, #9B9AA7);
  box-shadow: 0 .5px 1px rgba(0, 0, 0, .35), 0 1.5px 4px rgba(0, 0, 0, .25);
}

html[data-theme="dark"] .ru-notification-bell-panel {
  background: var(--haitang-card, #1F1F1F);
  border-color: var(--haitang-border, rgba(255, 255, 255, .08));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .ru-notification-bell-item:hover { background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .ru-notification-bell-item-title { color: var(--haitang-text, #F3EEE4); }
