/* FAVORITES-20261101 收藏 — 小克（11-01）。fav.js 的样子：聊天里的小星星、提示条、侧栏长格子、收藏页（星星罐 + 彩色纸条 + 哄哄我）。 */

/* ---------- 聊天里：Vael 每条消息下面的小星星（在「引用」和「贴表情」中间） ---------- */
.fav-btn { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 28px; min-height: 28px;
  margin: 0; padding: 4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.fav-btn svg { display: block; width: 18px; height: 18px; overflow: visible; pointer-events: none; }
.fav-btn svg path { fill: transparent; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; transition: fill .18s ease, stroke .18s ease; }
.fav-btn.on { color: #f2b23e; }
.fav-btn.on svg path { fill: currentColor; }
.fav-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.fav-btn.fav-pop svg { animation: fav-pop .52s cubic-bezier(.3, 1.6, .5, 1); }
.fav-btn.fav-pop::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 -12px 0 #f2b23e, 11px -4px 0 #f6c35b, 7px 10px 0 #f2a3b6, -7px 10px 0 #f6c35b, -11px -4px 0 #f2b23e;
  animation: fav-burst .55s ease-out forwards; }
@keyframes fav-pop { 0% { transform: scale(.55); } 45% { transform: scale(1.34) rotate(-10deg); } 100% { transform: none; } }
@keyframes fav-burst { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
/* 贴表情那一行本来 264px 宽：多了一颗星星就多给 32px，表情格子还是原来那么宽 */
.msg-actions:has(> .fav-btn):has(> .dui-reactions) { width: 296px; }

/* ---------- 提示条（收好了 / 取消收藏了 · 撤销） ---------- */
.fav-toast { position: fixed; left: 50%; top: calc(var(--sat, env(safe-area-inset-top)) + 88px); z-index: 1500; display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 40px); box-sizing: border-box; padding: 9px 16px; border-radius: 999px; background: rgba(36, 31, 27, .9); color: #fbf6ee;
  font-size: 13.5px; line-height: 18px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  opacity: 0; transform: translate(-50%, -8px) scale(.98); pointer-events: none; transition: opacity .2s ease, transform .28s cubic-bezier(.2, .8, .2, 1); }
.fav-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fav-toast span { overflow: hidden; text-overflow: ellipsis; }
.fav-toast button { flex: none; margin: -4px -7px -4px 0; padding: 4px 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .14);
  color: #ffd27a; font: inherit; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fav-toast button:active { background: rgba(255, 255, 255, .24); }

/* ---------- 侧栏：格子最下面一个长条「收藏」 ---------- */
.menu.sidebar .sbd-tiles .sbd-tile.sbd-fav { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 0; padding: 13px 14px; }
.sbd-fav .sbd-tile-ic { flex: none; }
.menu.sidebar.sb2 .sbd-tile.sbd-fav .sbd-tile-ic { background: linear-gradient(150deg, #f8cf63, #ea9b31); }

/* ---------- 收藏页 ---------- */
#fv { --fv-bg: #f6f0e6; --fv-bg2: #eee4d3; --fv-card: #fffcf7; --fv-ink: #2f2823; --fv-dim: #8e8274; --fv-line: rgba(70, 50, 30, .1);
  --fv-tint: 16%; --fv-shade: rgba(84, 58, 32, .16); --fv-glass-line: rgba(112, 86, 60, .34); --fv-cork: #d6b18a; --fv-cork2: #b48a62; --fv-hi: rgba(255, 255, 255, .78);
  --fv-serif: ui-serif, "New York", "Songti SC", "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  position: relative; height: 100%; overflow: hidden; color: var(--fv-ink);
  background: radial-gradient(130% 70% at 50% -8%, #fdf9f3 0%, var(--fv-bg) 58%, var(--fv-bg2) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; }
#fv::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] #fv { --fv-bg: #17140f; --fv-bg2: #100e0b; --fv-card: #231e19; --fv-ink: #efe6d8; --fv-dim: #a19583; --fv-line: rgba(255, 240, 220, .1);
  --fv-tint: 10%; --fv-shade: rgba(0, 0, 0, .5); --fv-glass-line: rgba(255, 236, 212, .3); --fv-cork: #8d7053; --fv-cork2: #6c533c; --fv-hi: rgba(255, 255, 255, .26);
  background: radial-gradient(130% 70% at 50% -8%, #221d17 0%, var(--fv-bg) 58%, var(--fv-bg2) 100%); }
:root[data-theme="dark"] #fv::before { opacity: .35; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #fv { --fv-bg: #17140f; --fv-bg2: #100e0b; --fv-card: #231e19; --fv-ink: #efe6d8; --fv-dim: #a19583; --fv-line: rgba(255, 240, 220, .1);
    --fv-tint: 10%; --fv-shade: rgba(0, 0, 0, .5); --fv-glass-line: rgba(255, 236, 212, .3); --fv-cork: #8d7053; --fv-cork2: #6c533c; --fv-hi: rgba(255, 255, 255, .26);
    background: radial-gradient(130% 70% at 50% -8%, #221d17 0%, var(--fv-bg) 58%, var(--fv-bg2) 100%); }
  :root:not([data-theme="light"]) #fv::before { opacity: .35; }
}
.fv-scroll { position: absolute; inset: 0; z-index: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: calc(var(--sat, env(safe-area-inset-top)) + 46px) 16px calc(var(--sab, env(safe-area-inset-bottom)) + 40px); box-sizing: border-box; }
.fv-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; gap: 10px; box-sizing: border-box;
  height: calc(var(--sat, env(safe-area-inset-top)) + 52px); padding: var(--sat, env(safe-area-inset-top)) 14px 0;
  transition: background-color .25s, box-shadow .25s; pointer-events: none; }
.fv-bar > * { pointer-events: auto; }
.fv-bar.solid { background: color-mix(in srgb, var(--fv-bg) 84%, transparent); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 .5px 0 var(--fv-line); }
.fv-bar-sp { flex: none; width: 34px; }
.fv-bar-t { flex: 1; text-align: center; font-size: 16px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; }
.fv-bar.solid .fv-bar-t { opacity: 1; }
#fv .fp-close { color: var(--fv-ink); border-color: var(--fv-line); background: color-mix(in srgb, var(--fv-ink) 6%, transparent); }
#fv .fp-close:active { background: color-mix(in srgb, var(--fv-ink) 12%, transparent); }

/* 上面：星星罐 + 标题 + 哄哄我 */
.fv-head { position: relative; padding: 0 0 24px; text-align: center; }
.fv-jar { display: block; width: 138px; margin: 0 auto; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fv-jar svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 92%; transition: transform .14s ease; }
.fv-jar:active svg { transform: scale(.965); }
.fv-jar.fv-shake svg { animation: fv-shake .48s ease; }
.fv-jar:focus-visible { outline: 2px solid var(--fv-dim); outline-offset: 6px; border-radius: 20px; }
.fv-ground { fill: var(--fv-shade); opacity: .55; }
.fv-jar-glass { fill: url(#fv-gl); }
:root[data-theme="dark"] .fv-jar-glass { fill: rgba(255, 255, 255, .05); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fv-jar-glass { fill: rgba(255, 255, 255, .05); } }
.fv-jar-line { fill: none; stroke: var(--fv-glass-line); stroke-width: 2; }
.fv-jar-hi { fill: none; stroke: var(--fv-hi); stroke-width: 5; stroke-linecap: round; }
.fv-jar-hi2 { fill: none; stroke: var(--fv-hi); stroke-width: 3; stroke-linecap: round; opacity: .6; }
.fv-cork { fill: var(--fv-cork); }
.fv-cork-l { fill: none; stroke: var(--fv-cork2); stroke-width: 1.2; opacity: .75; }
.fv-st { stroke-linejoin: round; }
.fv-anim .fv-st { animation: fv-drop .56s cubic-bezier(.3, 1.25, .5, 1) both; }
.fv-title { margin: 12px 0 0; font: 600 25px/1.25 var(--fv-serif); letter-spacing: .14em; text-indent: .14em; }
.fv-sub { margin: 5px 0 0; color: var(--fv-dim); font-size: 13px; line-height: 1.4; letter-spacing: .04em; }
.fv-coax { display: inline-flex; align-items: center; gap: 7px; height: 40px; margin: 16px 0 0; padding: 0 22px 0 19px; border: 0; border-radius: 999px;
  background: var(--fv-ink); color: var(--fv-bg); font: inherit; font-size: 15px; font-weight: 600; letter-spacing: .08em; cursor: pointer;
  box-shadow: 0 8px 18px -8px var(--fv-shade), 0 1px 2px var(--fv-shade); -webkit-tap-highlight-color: transparent; transition: transform .12s ease, opacity .2s; }
.fv-coax svg { width: 15px; height: 15px; color: #f6c35b; }
.fv-coax:active { transform: scale(.96); }
.fv-coax[hidden] { display: none; }
.fv-fly { position: absolute; z-index: 3; width: 22px; height: 22px; pointer-events: none; animation: fv-fly .62s cubic-bezier(.2, .7, .3, 1) forwards; }
.fv-fly svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fv-fly path { fill: var(--c); stroke: var(--c); stroke-width: 2.6; stroke-linejoin: round; }
.fv-search { display: flex; align-items: center; gap: 8px; max-width: 380px; height: 40px; margin: 18px auto 0; padding: 0 12px; box-sizing: border-box;
  border-radius: 13px; background: color-mix(in srgb, var(--fv-ink) 6%, transparent); color: var(--fv-dim); text-align: left; }
.fv-search[hidden] { display: none; }
.fv-search svg { flex: none; width: 17px; height: 17px; }
.fv-search input { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; background: none; color: var(--fv-ink); font: inherit; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; }
.fv-search input::placeholder { color: var(--fv-dim); }

/* 下面：一张张彩色纸条 */
.fv-list { max-width: 560px; margin: 0 auto; }
.fv-card { --c: #f2a3b6; position: relative; margin: 0 0 12px; padding: 15px 17px 9px; border-radius: 18px;
  background: color-mix(in srgb, var(--c) var(--fv-tint), var(--fv-card));
  box-shadow: 0 1px 2px var(--fv-shade), 0 10px 22px -16px var(--fv-shade), inset 0 0 0 .5px color-mix(in srgb, var(--c) 34%, transparent); }
.fv-list.fv-enter .fv-card { animation: fv-card-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.fv-list.fv-enter .fv-card:nth-child(2) { animation-delay: .05s; } .fv-list.fv-enter .fv-card:nth-child(3) { animation-delay: .1s; }
.fv-list.fv-enter .fv-card:nth-child(4) { animation-delay: .15s; } .fv-list.fv-enter .fv-card:nth-child(n+5) { animation-delay: .2s; }
.fv-card.fv-back { animation: fv-back .42s cubic-bezier(.2, .8, .2, 1) both; }
.fv-card.fv-going { overflow: hidden; opacity: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; animation: none;
  transition: height .26s ease, opacity .2s ease, margin .26s ease, padding .26s ease; }
.fv-body { font-family: var(--fv-serif); font-size: 16px; line-height: 1.72; letter-spacing: .01em; overflow-wrap: anywhere; }
.fv-body > * + * { margin-top: 9px; }
.fv-body p { margin: 0; } .fv-body p + p { margin-top: .45em; }
.fv-body strong, .fv-body b { font-weight: 700; }
.fv-body ul, .fv-body ol { margin: .2em 0; padding-left: 1.35em; }
.fv-body li + li { margin-top: .2em; }
.fv-body a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--fv-ink) 35%, transparent); }
.fv-body pre { margin: 0; padding: 9px 11px; overflow-x: auto; border-radius: 11px; background: color-mix(in srgb, var(--fv-ink) 6%, transparent);
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.fv-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.fv-body blockquote:not(.fv-q) { margin: 0; padding-left: 10px; border-left: 2px solid var(--fv-line); color: var(--fv-dim); }
.fv-a { color: var(--fv-dim); font-size: 14.5px; line-height: 1.65; }
.fv-q { margin: 0; padding: 1px 0 1px 10px; border-left: 2.5px solid color-mix(in srgb, var(--c) 72%, var(--fv-ink) 8%); color: var(--fv-dim);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; font-size: 13px; line-height: 1.6; }
.fv-s { display: block; width: 92px; max-width: 40%; border-radius: 8px; }
.fv-v .voice-msg { max-width: 100%; }
.fv-v .bubble.voice-b { position: relative; padding: 9px 12px; border-radius: 14px; background: color-mix(in srgb, var(--c) 30%, var(--fv-card)); color: var(--fv-ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.fv-v .vzh { margin: 6px 2px 0; color: var(--fv-ink); font-family: var(--fv-serif); font-size: 14.5px; line-height: 1.65; opacity: .82; }
.fv-card.clamp .fv-body { max-height: 270px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.fv-expand { display: block; margin: 2px 0 0; padding: 4px 0; border: 0; background: none; color: var(--fv-dim); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fv-expand[hidden] { display: none; }
.fv-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--fv-dim); font-size: 12px; line-height: 1.3; }
.fv-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-unstar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 0 -9px 0 0; padding: 0; border: 0;
  border-radius: 50%; background: none; color: #f2b23e; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fv-unstar svg { width: 18px; height: 18px; overflow: visible; }
.fv-unstar path { fill: currentColor; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; }
.fv-unstar:active { transform: scale(.88); }
.fv-empty { padding: 26px 26px 10px; color: var(--fv-dim); font-size: 14px; line-height: 1.8; text-align: center; }
.fv-foot { padding: 6px 0 4px; color: var(--fv-dim); font-size: 12px; text-align: center; letter-spacing: .06em; opacity: .8; }

/* 哄哄我：抽出来的那张纸条 */
.fv-draw { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; box-sizing: border-box;
  padding: calc(var(--sat, env(safe-area-inset-top)) + 24px) 22px calc(var(--sab, env(safe-area-inset-bottom)) + 26px);
  background: rgba(26, 20, 15, 0); transition: background-color .28s ease, -webkit-backdrop-filter .28s ease, backdrop-filter .28s ease; }
.fv-draw.on { background: rgba(26, 20, 15, .46); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.fv-draw.off { background: rgba(26, 20, 15, 0); -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
.fv-note-wrap { display: flex; justify-content: center; width: 100%; min-height: 0; padding-top: 15px; }
.fv-note { --c: #f2a3b6; position: relative; box-sizing: border-box; width: min(340px, 100%);
  border-radius: 20px; color: var(--fv-ink); background: color-mix(in srgb, var(--c) calc(var(--fv-tint) + 4%), var(--fv-card));
  box-shadow: 0 28px 60px -14px rgba(0, 0, 0, .45), inset 0 0 0 .5px color-mix(in srgb, var(--c) 40%, transparent);
  transform: rotate(-1deg); animation: fv-note-in .46s cubic-bezier(.2, 1.15, .4, 1) both; }
.fv-draw.off .fv-note { animation: fv-note-out .22s ease forwards; }
.fv-note-in { max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; padding: 30px 24px 18px; border-radius: inherit; }
.fv-note-star { position: absolute; z-index: 1; left: 50%; top: -15px; width: 30px; height: 30px; margin-left: -15px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }
.fv-note-star svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fv-note-star path { fill: var(--c); stroke: var(--c); stroke-width: 2.4; stroke-linejoin: round; }
.fv-note .fv-body { font-size: 18px; line-height: 1.8; }
.fv-note .fv-a { font-size: 15.5px; }
.fv-sign { margin-top: 18px; color: var(--fv-dim); font: 13px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; text-align: right; }
.fv-sign i { font: italic 15px/1.4 var(--fv-serif); letter-spacing: .02em; }
.fv-draw-acts { display: flex; gap: 12px; animation: fv-acts-in .4s .12s ease both; }
.fv-draw.off .fv-draw-acts { animation: fv-fade-out .15s ease forwards; }
.fv-draw-acts button { height: 44px; padding: 0 22px; border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; letter-spacing: .04em; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease; }
.fv-draw-acts button:active { transform: scale(.95); }
.fv-again { background: #fffcf7; color: #2f2823; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4); }
.fv-done { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42); }

@keyframes fv-drop { from { opacity: 0; transform: translateY(-20px); } }
@keyframes fv-shake { 20% { transform: rotate(-5deg); } 45% { transform: rotate(4deg); } 70% { transform: rotate(-2deg); } 100% { transform: none; } }
@keyframes fv-fly { 0% { opacity: 0; transform: translateY(16px) scale(.5); } 22% { opacity: 1; } 100% { opacity: 0; transform: translateY(-70px) scale(1.8) rotate(170deg); } }
@keyframes fv-card-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes fv-back { from { opacity: 0; transform: scale(.95); } }
@keyframes fv-note-in { from { opacity: 0; transform: translateY(22px) scale(.9) rotate(-5deg); } }
@keyframes fv-note-out { to { opacity: 0; transform: translateY(14px) scale(.96) rotate(-1deg); } }
@keyframes fv-fade-out { to { opacity: 0; } }
@keyframes fv-acts-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  .fav-btn.fav-pop svg, .fav-btn.fav-pop::after, .fv-anim .fv-st, .fv-jar.fv-shake svg, .fv-list.fv-enter .fv-card, .fv-card.fv-back, .fv-note, .fv-draw-acts { animation: none; }
  .fav-toast, .fv-draw, .fv-card.fv-going, .fv-bar, .fv-jar svg { transition: none; }
}
