/* ── 选图弹窗 ──
   颜色映射（Krea 暗色主题，与 enhancer.css 中 #enhancer-content 变量覆盖一致）：
   #101010 = --primary-950    #202020 = --primary-850
   #262626 = --primary-800    #a3a3a3 = --primary-400 / --muted-foreground
   oklch(48.8% .243 264.376) = --sidebar-primary / action blue
*/
.ec-assets-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.9);
  padding: 1rem;
}
.ec-assets-backdrop--open { display: flex; }

.ec-assets-dialog {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  border-radius: 1rem;
  overflow: hidden;
  background: #101010;
}
@media (min-width: 640px) {
  .ec-assets-dialog { width: 80%; height: 80%; }
}

/* ── 关闭按钮 ── */
.ec-assets-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a3a3a3;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease-out, background-color 0.15s ease-out;
}
.ec-assets-close:hover { color: #fff; background: #202020; }

/* ── 左侧边栏 ── */
.ec-assets-sidebar-inner {
  width: 14rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 1rem 0 0 0;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.ec-assets-sidebar-inner::-webkit-scrollbar { display: none; }

@media (max-width: 639px) {
  .ec-assets-sidebar-inner { display: none; }
}

/* ── 搜索 ── */
.ec-assets-search-wrap {
  position: relative;
  padding: 0 0.5rem 0.5rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ec-assets-search-icon {
  position: absolute;
  top: 50%;
  left: 1.375rem;
  transform: translateY(-50%);
  color: #a3a3a3;
}
.ec-assets-search-input {
  width: 100%;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: none;
  background: #202020;
  color: #fff;
  padding: 0.25rem 0.75rem 0.25rem 2.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
}
.ec-assets-search-input::placeholder { color: #a3a3a3; }

/* ── 菜单分组 ── */
.ec-assets-menu-group {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ec-assets-menu-list { list-style: none; margin: 0; padding: 0; }
.ec-assets-menu-label {
  font-size: 0.875rem;
  font-weight: 450;
  color: #a3a3a3;
  padding: 0.25rem 1rem;
}

/* ── 菜单按钮 ── */
.ec-assets-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  height: 2.25rem;
  border-radius: 0.5rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 450;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.1s ease-out;
  font-family: inherit;
  text-align: left;
}
.ec-assets-menu-btn:hover { background: #202020; }

.ec-assets-menu-btn--active {
  background: oklch(48.8% .243 264.376);
  color: #fff;
}
.ec-assets-menu-btn--active:hover { background: oklch(48.8% .243 264.376); }

.ec-assets-menu-btn--type-active {
  color: #fff;
  background: transparent;
}
.ec-assets-menu-btn--type-active:hover { background: #202020; }

.ec-assets-menu-icon { color: #a3a3a3; flex-shrink: 0; }
.ec-assets-menu-icon-active { color: #fff; flex-shrink: 0; }

/* ── Badge ── */
.ec-assets-menu-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: 450;
  flex-shrink: 0;
  margin-left: auto;
}
.ec-assets-menu-badge--active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.ec-assets-menu-badge--muted {
  background: #262626;
  color: #a3a3a3;
}
.ec-assets-menu-badge--type-active {
  background: #262626;
  color: #a3a3a3;
}

/* ── More 按钮 ── */
.ec-assets-menu-item-more { padding: 0.5rem 0; }
.ec-assets-menu-btn--more {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 450;
  color: #a3a3a3;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease-out;
}
.ec-assets-menu-btn--more:hover { color: #fff; }

/* ── 右侧网格 ── */
.ec-assets-grid-wrap {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 1rem;
}
.ec-assets-grid-wrap::-webkit-scrollbar { display: none; }
.ec-assets-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
}

/* ── 图片卡 ── */
.ec-assets-card {
  width: 120px;
  height: 120px;
  border-radius: 0.375rem;
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
  flex-shrink: 0;
  background: transparent;
  transition: filter 0.15s ease-out, transform 0.15s ease-out;
  filter: brightness(0.85);
}
.ec-assets-card:hover { filter: brightness(1); }
.ec-assets-card:active { transform: scale(0.98); }
.ec-assets-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
