/* ============================================
   AVATAR 模块样式
   从 index.html 提取
   ============================================ */
/* 引入主题变量 */
@import url('/common/frontend/styles/theme.css');

.avatar-card-box {
  width: 180px; height: 165px; max-height: 165px;
  border: 2px dashed var(--border-color); border-radius: 6px;
  background: var(--bg-tertiary); cursor: pointer; transition: all 0.2s;
  flex-shrink: 0; box-sizing: border-box; padding: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.avatar-card-box:hover { border-color: var(--accent-start); background: rgba(var(--accent-rgb), 0.1); }
.avatar-content-box {
  width: 180px; height: 165px; max-height: 165px;
  border: 1px solid var(--border-color); border-radius: 6px; padding: 4px;
  overflow-y: auto;  flex-shrink: 0; box-sizing: border-box;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
  gap: 4px;
}
/* 双排模式已移除，固定5列 */
.avatar-grid.expanded {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
}
.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius:6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  min-width: 0; /* Force grid column constraint */
  overflow: hidden; /* Clip oversized content */
}
.avatar-item:hover { border-color: var(--accent-start); }
.avatar-item.active { outline: 2px solid var(--accent-start); border-radius:4px; }
.avatar-emoji { font-size:20px; }
.avatar-name { display: none !important; }
.avatar-item.active .avatar-name { color: var(--text-primary); }
.preset-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  min-width: 0;
  overflow: hidden;
}
.preset-avatar-item:hover { border-color: var(--accent-start); }
.preset-avatar-item.active { outline: 2px solid var(--accent-start); border-radius:4px; }
.preset-avatar-item.active .avatar-name { color: var(--text-primary); }

/* My tab: 3 equal tall content boxes */
.my-content-box {
  flex: 1;
  min-width: 0;
  background: var(--bg-card, rgba(255,255,255,0.03));
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  height: 165px; max-height: 165px;
  box-sizing: border-box;
}
.my-content-header {
  font-size:13px;
  color: var(--accent-start, var(--accent-start));
  margin-bottom: 4px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
  padding-bottom: 4px;
  flex-shrink: 0;
}
.my-content-list {
  flex: 1;
  overflow-y: auto; 
  overflow-x: hidden;
}
.my-content-list::-webkit-scrollbar {
  width: 3px;
}
.my-content-list::-webkit-scrollbar-thumb {
  background: var(--text-muted, rgba(255,255,255,0.2));
  border-radius:4px;
}
.my-content-empty {
  text-align: center;
  font-size:12px;
  color: var(--text-muted, rgba(255,255,255,0.3));
  padding: 20px 6px;
}

/* 隐藏双排按钮，固定5列显示 */
#expandGridBtn { display: none !important; }

/* 覆盖HTML内联样式，固定单行高度，超出滚动 */
.avatar-grid[id^="avatarGrid-"],
.avatar-grid#uploadAvatarGrid,
.avatar-grid#videoAvatarGrid,
.avatar-grid#avatarGrid-my {
  height: 180px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
/* 减少avatarCatBody内边距 */
#avatarCatBody { padding: 2px !important; }
/* 减少底部控制面板间距 */
#avatarAudioStatus { margin-top: 4px !important; }
#generateAvatarBtn { margin-top: 4px !important; }

/* 视频预览区铺满左侧容器，无滚动条 */
#avatarLeftContainer {
  overflow: hidden !important;
}
#avatarLeftPreview {
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 100% !important;
  min-height: 0 !important;
  align-items: center !important;
  justify-content: center !important;
}
#avatarPreviewVideo {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
/* 隐藏视频阅览区标签和其他占位元素 */
#avatarLeftContainer > div:not(#avatarLeftPreview):not(#currentDriveVideo) {
  display: none !important;
}
/* 形象选择区只占自然高度，剩余空间全给视频预览区 */
#panel-4 .panel-content > div:first-of-type {
  flex: 0 0 auto !important;
}