/* ============================================================
   FanCloud 头像
   顶栏头像 + 上传面板。样式与「墨青」主题同一套变量：
   圆形头像、发丝边框、茶青聚焦光。后台方正规则不作用于它。
   ============================================================ */

/* 顶栏头像按钮 */
.fc-avatar-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 9999px !important;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform .18s ease, box-shadow .18s ease;
}

.fc-avatar-btn:hover { transform: translateY(-1px); }

.fc-avatar-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--ring, #1fb6c9), 0 0 12px rgba(31, 182, 201, .35);
}

.fc-avatar-img,
.fc-avatar-mono {
  width: 34px;
  height: 34px;
  border-radius: 9999px !important;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(150, 190, 225, .28);
  box-shadow: 0 0 0 3px rgba(31, 182, 201, .1);
}

html:not(.dark) .fc-avatar-img,
html:not(.dark) .fc-avatar-mono {
  border-color: rgba(27, 36, 48, .14);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .08);
}

.fc-avatar-mono {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #05202a;
  background: linear-gradient(145deg, #5af0fa, #1fb6c9 55%, #0f766e);
  text-transform: uppercase;
  user-select: none;
}

/* 头像上的小圆点提示（未设置头像时） */
.fc-avatar-btn[data-empty="1"]::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--fc-gold, #c8a45c);
  box-shadow: 0 0 0 2px var(--background, #070b12);
}

/* ---------- 面板 ---------- */
.fc-avatar-panel {
  position: fixed;
  z-index: 2147483000;
  width: 296px;
  padding: 16px;
  border-radius: 2px;
  border: 1px solid var(--border, rgba(150, 190, 225, .14));
  background: var(--popover, #0c1521);
  color: var(--foreground, #e6eef8);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
  font-family: var(--fc-font-ui, "LXGW WenKai", "Microsoft YaHei", sans-serif);
  font-size: 13px;
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}

.fc-avatar-panel[data-open="1"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fc-avatar-panel::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(31, 182, 201, .6), rgba(31, 182, 201, 0) 60%);
}

.fc-avatar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.fc-avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 9999px !important;
  object-fit: cover;
  border: 1px solid var(--border, rgba(150, 190, 225, .18));
  background: #0f1a27;
  flex: 0 0 auto;
}

.fc-avatar-meta { min-width: 0; }

.fc-avatar-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-avatar-sub {
  font-size: 11.5px;
  color: var(--muted-foreground, #8ba0b8);
  margin-top: 3px;
  line-height: 1.5;
}

.fc-avatar-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.fc-avatar-actions button {
  flex: 1;
  height: 30px;
  border-radius: 2px !important;
  border: 1px solid var(--border, rgba(150, 190, 225, .18));
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  letter-spacing: .02em;
  transition: border-color .15s ease, background .15s ease;
}

.fc-avatar-actions button:hover {
  border-color: rgba(31, 182, 201, .5);
  background: rgba(31, 182, 201, .08);
}

.fc-avatar-actions button.primary {
  border-color: rgba(31, 182, 201, .55);
  background: linear-gradient(180deg, #22c3d6, #189aab);
  color: #04141a;
  font-weight: 600;
}

.fc-avatar-hint {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border, rgba(150, 190, 225, .12));
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted-foreground, #8ba0b8);
}

.fc-avatar-hint code {
  font-size: 10.5px;
  color: #9fe9f5;
  background: rgba(31, 182, 201, .1);
  padding: 1px 4px;
}

.fc-avatar-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  z-index: 2147483001;
  padding: 8px 16px;
  border-radius: 2px;
  border: 1px solid rgba(31, 182, 201, .4);
  background: #0c1521;
  color: #dff6fb;
  font-size: 12.5px;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.fc-avatar-toast[data-show="1"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 已替换过的站点原生字母头像不做额外处理，避免和图片叠影 */
[data-fc-avatar-done="1"] .fc-avatar-hidden,
[data-fc-avatar-done="1"] > span:not(.fc-avatar-keep) {
  visibility: hidden;
}
