/* ResetNow anonymous reactions. Loaded only on the v1 test build. */
.reactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
  padding-top: 0;
}

.reactions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.reaction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  min-width: 40px;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, transform 0.16s ease;
}

.reaction:hover { color: var(--ink); }
.reaction:hover .reaction-emoji { opacity: 0.9; transform: translateY(-1px); }
.reaction:active { transform: scale(0.96); }
.reaction:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.reaction[aria-pressed="true"] { color: var(--ink); }
.reaction[aria-pressed="true"] .reaction-emoji { opacity: 1; transform: translateY(-1px) scale(1.16); }

.reaction-emoji {
  font-size: 19px;
  line-height: 1.1;
  opacity: 0.62;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.reaction-count {
  min-height: 10px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.reaction-count[hidden] { display: none; }
.reaction[aria-pressed="true"] .reaction-count { color: var(--red); font-weight: 700; }

.reactions-prompt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Screen-reader feedback only; visible status text is a toast so the card
   never changes height when "已记录" appears or disappears. */
.reactions-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.reactions.is-pending { opacity: 0.72; }

.reaction-toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  max-width: min(calc(100vw - 32px), 360px);
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.reaction-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Detail variant: a small panel, not a dense card footer. */
.reactions-detail {
  display: block;
  margin-top: 24px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 253, 247, 0.55);
}
.reactions-detail .reactions-prompt { display: block; margin-bottom: 9px; font-size: 13px; }
.reactions-detail .reactions-row { gap: 5px; }
.reactions-detail .reaction { min-height: 50px; min-width: 40px; padding: 0 3px; }
.reactions-detail .reaction-emoji { font-size: 23px; }
.reactions-detail .reaction-count { font-size: 10.5px; }

html[data-theme="dark"] .reactions-detail { background: rgba(255, 255, 255, 0.035); }

@media (max-width: 720px) {
  .reactions { margin-top: 9px; padding-top: 0; }
  .reactions-detail { margin-top: 20px; padding: 13px 14px; }
  .reaction { min-height: 44px; padding: 0 1px; }
  .reactions-detail .reaction { min-height: 48px; padding: 0 2px; }
}


@media (prefers-reduced-motion: reduce) {
  .reaction, .reaction-emoji, .reaction-toast { transition: none; }
}

/* Click effects: emoji particles rise, pop, drop, or burst. */
.reaction-fx-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  pointer-events: none;
  contain: layout style paint;
}

.reaction-fx-particle,
.reaction-fx-confetti,
.reaction-fx-ring {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.reaction-fx-particle {
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.reaction-fx-confetti {
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.reaction-fx-ring {
  width: 14px;
  height: 14px;
  border: 2px solid;
  border-radius: 50%;
  transform-origin: center;
}

.reaction-fx-shake { animation: reaction-fx-shake 0.24s ease both; }

@keyframes reaction-fx-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .reaction-fx-layer { display: none; }
  .reaction-fx-shake { animation: none; }
}

/* Keep all six reactions on one line on 320px class devices. */
@media (max-width: 360px) {
  .reactions-detail .reactions-row { gap: 3px; }
  .reactions-detail .reaction { min-width: 36px; padding: 0 1px; }
}

/* Card padding leaves only ~246px on a 320px screen; keep six reactions
   on one row without shrinking the touch target too far. */
@media (max-width: 360px) {
  .reactions:not(.reactions-detail) .reactions-row { gap: 2px; }
  .reactions:not(.reactions-detail) .reaction { min-width: 38px; }
}
