/* ========================================= */
/* 文件：avatar-settings.css                    */
/* 功能：外观设置面板                           */
/*       ——头像预览区、扇形轮盘 (Me/Him/Home/BG)、*/
/*       星环流光动画、重置/保存胶囊按钮          */
/* ========================================= */

/* =========================================
   ✨ 外观设置 V2：新版扇形转盘设计 (兔咪终极整合版)
   ========================================= */
.av2-content {
  max-width: 300px !important;
  padding: 0 !important;
}

.av2-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.av2-header-left {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 1px;
}
.av2-header-left i { font-size: 16px; color: #ffb37a; }

/* 大预览区 */
.av2-preview-zone {
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 0 16px; cursor: pointer; gap: 10px;
}

/* 1. ✨ 改掉写死的宽和高，让外壳能"自适应"图片大小伸缩 */
.av2-preview-wrap {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/* 2. 圆形头像状态 */
.av2-preview-img {
  width: 130px; height: 130px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,179,122,0.45);
  box-shadow: 0 0 22px rgba(255,179,122,0.2);
  transition: border-radius 0.3s, width 0.3s, height 0.3s;
}

/* 3. 切换到 BG 时的竖长形手机比例 (9:16) */
.av2-preview-img.av2-rect {
  border-radius: 14px;
  width: 106px;
  height: 188px;
}

/* 悬浮遮罩和点击效果（保留原本代码，不用动） */
.av2-preview-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s, border-radius 0.3s;
}
.av2-preview-img.av2-rect ~ .av2-preview-overlay { border-radius: 14px; }
.av2-preview-zone:active .av2-preview-overlay { opacity: 1; }
.av2-preview-overlay i { font-size: 24px; color: #fff; }
.av2-slot-label {
  font-size: 11px; color: rgba(255,255,255,0.45); letter-spacing: 1.5px; text-transform: uppercase;
}

/* 底部区域：沉底对齐，拉开转盘和按钮的呼吸感 */
.av2-bottom {
  display: flex;
  align-items: flex-end; /* ✨ 魔法指令：从 center 改成 flex-end，让按钮强制落到底部和转盘平齐！ */
  padding: 4px 16px 22px;
  gap: 20px;
}

/* 扇形转盘容器（缩小到 80px + ✨ 机械凹陷质感） */
.av2-fan-area {
  flex-shrink: 0; position: relative;
  width: 80px; height: 80px;
  border-radius: 0 80px 0 0;
  overflow: hidden;
  touch-action: none; /* 让轮盘完全接管触摸，不被父层 pan-y 拦截 */
  /* ✨ 立体凹陷感：内部暗影 + 边缘微光 */
  box-shadow: inset 4px 4px 10px rgba(0,0,0,0.5), inset -1px -1px 3px rgba(255,255,255,0.05);
  background: rgba(10, 8, 20, 0.4); /* 给底盘一个深色背景 */
}

.av2-wheel {
  width: 80px; height: 80px;
  transform-origin: left bottom;
  cursor: grab;
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  will-change: transform;
}
.av2-wheel:active { cursor: grabbing; }
.av2-wheel svg { width: 100%; height: 100%; display: block; }

/* 扇形切片：用极暗的接缝取代死板直线 */
.av2-wsector {
  fill: rgba(255, 255, 255, 0.03);
  stroke: rgba(255, 255, 255, 0.04); /* 极其内敛的金属微缝 */
  stroke-width: 0.5;
  transition: fill 0.2s, stroke 0.2s;
  cursor: pointer;
}

/* 底座专属样式 */
.av2-wsector-base {
  fill: rgba(0,0,0,0.3);
  stroke: rgba(255,255,255,0.02);
  stroke-width: 0.5;
  pointer-events: none;
}

/* ✨ 选中时的高亮：大王指定的深空紫！ */
.av2-wsector.active {
  fill: rgba(61, 58, 102, 0.45) !important;
  stroke: rgba(162, 155, 254, 0.3) !important; /* 边缘微微泛起紫光 */
}

/* 扇形里的文字 */
.av2-wtext {
  font-size: 13px; font-weight: 500;
  fill: rgba(255,255,255,0.8);
  text-anchor: middle; dominant-baseline: middle;
  pointer-events: none; font-family: inherit;
}

/* =========================================
   ✨ 核心视觉：外圈星环流光层 (无间隙 Evol 爆发版)
   ========================================= */
.av2-ring-light {
  position: absolute;
  width: 160px; height: 160px; /* 以左下角为圆心放大两倍 */
  left: -80px; bottom: -80px;
  border-radius: 50%;

  /* ✨ 核心修改：重新定义 conic-gradient */
  /* 我们在圆环上同时放置了多道不同强度的光束（rgba止点越多，光束越丰富） */
  /* 并确保起始点（0%）和终点（100%）的颜色和透明度完全一致，实现完美无缝循环 */
  background: conic-gradient(
    from 0deg,
    rgba(162, 155, 254, 0.1) 0%,   /* 起始点微光 */
    rgba(162, 155, 254, 0.7) 10%,  /* 光束1强光 */
    rgba(162, 155, 254, 0.1) 20%,  /* 过渡微光 */
    rgba(162, 155, 254, 0.6) 30%,  /* 光束2 */
    rgba(162, 155, 254, 0.05) 50%, /* 暗区过渡 */
    rgba(162, 155, 254, 0.7) 70%,  /* 光束3强光 */
    rgba(162, 155, 254, 0.2) 85%,  /* 过渡 */
    rgba(162, 155, 254, 0.1) 100%  /* 终点微光，与起始点无缝衔接 */
  );

  /* ✨ 核心修改：将动画时间从 3s 缩短到 1.5s */
  /* 时间缩短会让流光变得急促、充满动感，从而彻底消除"静止间隙"的错觉 */
  animation: spinLight 3s linear infinite;

  pointer-events: none; /* 绝对不能挡住滑动交互 */
  z-index: 10;

  /* CSS 遮罩魔法：镂空中间区域，只留下边缘 1.5px 的光环 */
  -webkit-mask: radial-gradient(circle, transparent 78.5px, #000 79px);
  mask: radial-gradient(circle, transparent 78.5px, #000 79px);
}

@keyframes spinLight {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =========================================
   ✨ 按钮区：均匀分布排版设计
   ========================================= */

/* 右侧按钮列：占据剩余空间，让里面的按钮横向撑开 */
.av2-btn-col {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 12px; /* 两个胶囊之间的间距 */
  justify-content: space-between; /* 让按钮在容器里均匀分布 */
  align-items: center;
  margin-bottom: 0; /* 取消底边距，保持和转盘绝对水平 */
}

/* 恢复正常大小的胶囊按钮：自动平分空间 */
#avatar-modal .av2-btn,
#avatar-settings-drawer .av2-btn {
  flex: 1 !important;
  height: auto !important;
  width: auto !important;
  padding: 10px 0 !important;
  border-radius: 50px !important;
  font-size: 13px !important;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

/* 重置 (红宝石玻璃胶囊) */
#avatar-modal .av2-btn-reset,
#avatar-settings-drawer .av2-btn-reset {
  background: rgba(255, 71, 87, 0.15) !important;
  color: #ff4757 !important;
  border: 1px solid rgba(255, 71, 87, 0.3) !important;
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.1), inset 0 0 10px rgba(255, 71, 87, 0.05) !important;
}
#avatar-modal .av2-btn-reset:active,
#avatar-settings-drawer .av2-btn-reset:active {
  background: rgba(255, 71, 87, 0.25) !important;
  transform: scale(0.95);
}

/* 保存 (琥珀玻璃胶囊) */
#avatar-modal .av2-btn-save,
#avatar-settings-drawer .av2-btn-save {
  background: rgba(255, 179, 122, 0.15) !important;
  color: #ffb37a !important;
  border: 1px solid rgba(255, 179, 122, 0.3) !important;
  box-shadow: 0 0 10px rgba(255, 179, 122, 0.1), inset 0 0 10px rgba(255, 179, 122, 0.05) !important;
}
#avatar-modal .av2-btn-save:active,
#avatar-settings-drawer .av2-btn-save:active {
  background: rgba(255, 179, 122, 0.25) !important;
  transform: scale(0.95);
}

/* =========================================
   老版本的底层水晶质感容器样式（为你保留）
   ========================================= */

#avatar-modal .modal-content {
  background:
    linear-gradient(135deg, rgba(10, 8, 20, 0.75), rgba(5, 5, 12, 0.8)) padding-box,
    linear-gradient(135deg, rgba(255, 179, 122, 0.45), rgba(162, 155, 254, 0.4)) border-box !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid transparent !important;
  box-shadow:
    2px 2px 10px rgba(255, 179, 122, 0.15),
    -2px -2px 10px rgba(162, 155, 254, 0.15),
    0 40px 80px rgba(0, 0, 0, 0.6) !important;
  border-radius: 24px !important;
  overflow: hidden;
  padding-bottom: 20px;
}

#avatar-modal .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 15px 20px;
}

#avatar-modal .modal-title {
  font-size: 16px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* 为了防止老代码影响全局按钮，把下面的 #avatar-modal button 删除了，改用上方安全的 .av2-btn 统管 */

/* =========================================
   外观设置内嵌抽屉专属覆盖
   ========================================= */

/* 外观设置内嵌抽屉：轮盘贴左下角融合面板边框 */
#avatar-settings-drawer .av2-bottom {
  padding: 4px 16px 0 0;
}
/* 预览区上下留白收紧 */
#avatar-settings-drawer .av2-preview-zone {
  padding: 10px 0 8px;
}
/* 外观设置抽屉：按钮底部留白、按钮缩小、轮盘放大 */
#avatar-settings-drawer .av2-btn-col {
  margin-bottom: 22px;
}
#avatar-settings-drawer .av2-btn {
  padding: 7px 0 !important;
  font-size: 12px !important;
}
#avatar-settings-drawer .av2-fan-area {
  width: 110px;
  height: 110px;
  border-radius: 0 110px 0 0;
}
#avatar-settings-drawer .av2-wheel {
  width: 110px;
  height: 110px;
}
/* 流光环同步放大：从 80px 基准比例缩放到 110px */
#avatar-settings-drawer .av2-ring-light {
  width: 220px;
  height: 220px;
  left: -110px;
  bottom: -110px;
  -webkit-mask: radial-gradient(circle, transparent 108px, #000 108.5px);
  mask: radial-gradient(circle, transparent 108px, #000 108.5px);
}
