/* ============================================================
   components: 头像 / 情绪 / 卡片 / 弹层 / 反馈
   ============================================================ */

/* ---------- 头像与棱面视觉 ---------- */
.av {
  --av-size: 40px;
  position: relative;
  flex: none;
  width: var(--av-size);
  height: var(--av-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: calc(var(--av-size) * .42);
  color: #fff;
  font-weight: 600;
  letter-spacing: .02em;
  background: #2a2a38;
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.av::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 20% 10%, rgba(255, 255, 255, .34), transparent 46%);
  z-index: -1;
}
.av--xs { --av-size: 28px; }
.av--sm { --av-size: 34px; }
.av--md { --av-size: 44px; }
.av--lg { --av-size: 58px; }
.av--xl { --av-size: 84px; }

.av--prism { background: linear-gradient(140deg, #8b5cff, #4fa8ff 55%, #2ee6d6); }
.av--dusk { background: linear-gradient(140deg, #3a2f6b, #6b4bd6 60%, #b07cff); }
.av--tide { background: linear-gradient(140deg, #0f6e8c, #23b5b5 60%, #7ff0d8); }
.av--ember { background: linear-gradient(140deg, #b03a2e, #f0824a 55%, #ffc46b); }
.av--moss { background: linear-gradient(140deg, #2f5d3f, #6fae6b 60%, #c5e88f); }
.av--violet { background: linear-gradient(140deg, #5b2a86, #9b5cff 60%, #e0a6ff); }
.av--rose { background: linear-gradient(140deg, #a32d5c, #ff6fa8 60%, #ffc0d8); }
.av--steel { background: linear-gradient(140deg, #38414f, #6f7d90 60%, #b9c4d4); }
.av--indigo { background: linear-gradient(140deg, #2a2a6b, #4a4ab0 60%, #8f8fe0); }
.av--mask {
  background: linear-gradient(140deg, #23232e, #3b3b4c 60%, #55556a);
  color: rgba(255, 255, 255, .82);
}
.av--mask::after { background: linear-gradient(140deg, rgba(139, 92, 255, .26), transparent 60%); }

/* 情绪环 */
.av__ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 180deg, var(--ring, var(--accent)) 0deg, transparent 260deg, var(--ring, var(--accent)) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  opacity: .85;
}

/* ---------- 情绪 ---------- */
.mood {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  white-space: nowrap;
}
.mood__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.mood--lime { color: #a8e063; }
.mood--rose { color: #ff8fb8; }
.mood--flame { color: #ff9a5a; }
.mood--cyan { color: #4fe3d4; }
.mood--violet { color: #b491ff; }
.mood--indigo { color: #8f9bff; }
.mood--amber { color: #ffb454; }
.mood--steel { color: #b9c4d4; }
.mood--mist { color: #a9a9bd; }

.spectrum-bar {
  position: relative;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b4a8c, #4fe3d4 42%, #ffc46b 68%, #ff6fa8);
  opacity: .55;
}
.spectrum-bar__pin {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card--pad-lg { padding: 20px; }
.card--flat { background: transparent; border-color: transparent; }

.hover-lift { transition: border-color .2s var(--ease), background .2s, transform .2s; }
.hover-lift:hover { border-color: var(--line-2); background: var(--surface-2); }

/* ---------- 动态卡 ---------- */
.post {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
  cursor: pointer;
}
.post:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.post.is-new { animation: post-in .45s var(--ease); }
@keyframes post-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.post__body { min-width: 0; display: grid; gap: 7px; }
.post__top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.post__face {
  font-weight: 650;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.post__face .mask-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(139, 92, 255, .16);
  color: var(--accent);
  border: 1px solid rgba(139, 92, 255, .28);
}
.post__handle { font-size: 12px; color: var(--faint); font-family: var(--font-mono); }
.post__time { font-size: 11.5px; color: var(--faint); margin-left: auto; white-space: nowrap; }
.post__text {
  font-size: 14.8px;
  line-height: 1.72;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: .002em;
}
.post__text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 9;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post__media {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, 1fr);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 4px;
}
.post__media img { width: 100%; height: 100%; object-fit: cover; max-height: 320px; }
.post__media--single { grid-template-columns: 1fr; }

.post__quote {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 4px;
  background: var(--surface-2);
}
.post__quote .post__text { font-size: 13.6px; }

.post__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  margin-left: -8px;
}
.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--faint);
  font-size: 12.5px;
  font-family: var(--font-mono);
  transition: color .18s, background .18s, transform .18s;
}
.act:hover { background: var(--surface-2); color: var(--text-2); }
.act:active { transform: scale(.94); }
.act.is-on { color: var(--pink); }
.act.is-on .act__icon { animation: pop .34s var(--ease); }
.act__icon { font-size: 14.5px; }
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* ---------- 分段器 ---------- */
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.segmented__btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--dim);
  transition: all .2s var(--ease);
}
.segmented__btn:hover { color: var(--text); }
.segmented__btn.is-on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 6px -2px rgba(0, 0, 0, .5);
}

/* ---------- 列表行 ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: background .18s;
}
.row:hover { background: var(--surface-2); }
.row__body { flex: 1; min-width: 0; }
.row__title { font-size: 13.8px; font-weight: 600; }
.row__sub {
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 提示条 / 空态 ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 54px 24px;
  text-align: center;
  color: var(--dim);
}
.empty__mark {
  font-size: 30px;
  opacity: .5;
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.empty__title { font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.empty__desc { font-size: 12.5px; max-width: 300px; line-height: 1.6; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-in .3s var(--ease);
  pointer-events: auto;
}
.toast--ok { border-color: rgba(79, 227, 212, .4); }
.toast--err { border-color: rgba(255, 107, 107, .45); color: #ff9b9b; }
.toast.is-out { animation: toast-out .26s var(--ease) forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px) scale(.97); }
}

/* ---------- 弹层 ---------- */
.modal-root { position: relative; z-index: 150; }
.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in .22s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } }

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(94vw, 500px);
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  animation: modal-in .3s var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.97); }
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal__title { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.modal__desc { font-size: 12.8px; color: var(--dim); margin-top: 3px; line-height: 1.6; }
.modal__body { display: grid; gap: 14px; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border-top: 1px solid var(--line-2);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-in .32s var(--ease);
  box-shadow: 0 -20px 50px -30px rgba(0, 0, 0, .8);
}
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet__grip {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: var(--line-2);
  margin: 0 auto 14px;
}

/* ---------- 其它 ---------- */
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.pill-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dim);
  animation: blink 1.2s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}
