/* avatar.css — extracted from avatar.html */
/* Avatar.css */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-default);
  flex-shrink: 0;
}

.avatar:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── 图片 ──────────────────────────── */
.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── 占位符 ──────────────────────────── */
.avatar__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: inherit;
  color: inherit;
}

.avatar__placeholder svg {
  width: 60%;
  height: 60%;
  opacity: 0.8;
}

/* ── 文字头像 ──────────────────────────── */
.avatar__text {
  font-size: inherit;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ── 状态指示器 ──────────────────────────── */
.avatar__status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 25%;
  height: 25%;
  min-width: 8px;
  min-height: 8px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-surface);
  background: var(--color-text-muted);
}

.avatar__status--online {
  background: var(--color-success);
}

.avatar__status--busy {
  background: var(--color-danger);
}

.avatar__status--away {
  background: var(--color-warning);
}

/* ── 尺寸 ──────────────────────────── */
.avatar--xs {
  width: 24px;
  height: 24px;
  font-size: var(--text-xs);
  border-width: 1px;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: var(--text-sm);
  border-width: 1.5px;
}

.avatar--md {
  width: 40px;
  height: 40px;
  font-size: var(--text-base);
}

.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: var(--text-lg);
  border-width: 2.5px;
}

.avatar--xl {
  width: 80px;
  height: 80px;
  font-size: var(--text-2xl);
  border-width: 3px;
}

/* ── 变体样式 ──────────────────────────── */
.avatar--default {
  border-radius: var(--radius-md);
}

.avatar--circle {
  border-radius: var(--radius-full);
}

.avatar--square {
  border-radius: var(--radius-sm);
}

/* ── 头像组 ──────────────────────────── */
.avatar-group {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.avatar-group .avatar {
  margin-left: -12px;
  transition: transform var(--duration-normal) var(--ease-default);
}

.avatar-group .avatar:hover {
  transform: translateY(-4px);
  z-index: 10;
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

.avatar-group--stacked .avatar {
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
}

/* ── 更多头像指示器 ──────────────────────────── */
.avatar--more {
  background: var(--color-bg-muted);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  border-color: var(--color-border);
}

/* ── 暗黑模式适配 ──────────────────────────── */
[data-theme="dark"] .avatar {
  background: var(--color-primary);
  border-color: var(--color-surface);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .avatar__status {
  border-color: var(--color-surface);
}

[data-theme="dark"] .avatar--more {
  background: var(--color-bg-muted);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

[data-theme="dark"] .avatar-group .avatar {
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.3);
}