/* 全站统一下拉框（components/Select.js）：颜色全部取自主题语义变量，切换主题自动跟随；
   列表锚定在触发器原位置，默认向下展开，空间不足时由脚本切换为向上展开。 */
.custom-select { position: relative; width: 100%; min-width: 0; }
.select-trigger { width: 100%; min-width: 0; }
.select-trigger:hover:not(:disabled) { border-color: var(--accent); }
.select-value { display: flex; align-items: center; gap: 10px; min-width: 0; }
.select-value .select-label-copy > strong {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.select-label-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.select-label-copy > strong { font-weight: inherit; }
.select-label-copy > small { display: flex; align-items: center; gap: 4px; color: var(--success); font-size: 11px; }
.select-trigger > .icon {
  flex-shrink: 0; color: var(--muted); transition: transform var(--duration-fast) ease, color var(--duration-fast);
}
.select-trigger[aria-expanded="true"] > .icon { transform: rotate(180deg); color: var(--accent); }

.select-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  max-height: min(260px, 45vh); max-height: min(260px, 45dvh);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 5px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius-control); background: var(--surface); color: var(--text);
  box-shadow: 0 14px 34px var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
  transform-origin: top center; animation: select-list-in var(--duration-fast) ease-out;
}
.custom-select[data-placement="top"] .select-list {
  top: auto; bottom: calc(100% + 6px); transform-origin: bottom center;
  animation-name: select-list-up;
}
.custom-select[data-align="end"] .select-list { left: auto; min-width: max(100%, 148px); width: max-content; max-width: 280px; }

.select-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 42px; padding: 9px 10px; border-radius: calc(var(--radius-control) - 3px);
  color: var(--text); font-size: 14px; cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.select-option + .select-option { margin-top: 2px; }
.select-option-copy { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.select-option > .icon { flex-shrink: 0; color: var(--accent); visibility: hidden; }
.select-option:is(:hover, .active) { background: var(--hover-surface); }
.select-option[aria-selected="true"] { color: var(--accent-hover); background: var(--selected-surface); font-weight: 500; }
.select-option[aria-selected="true"] > .icon { visibility: visible; }
.select-asset-image { display: block; width: 55px; height: 50px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }

/* 紧凑尺寸用于筛选、排序等工具栏。 */
.custom-select[data-size="compact"] .select-trigger {
  min-height: 36px; padding: 6px 10px; gap: 6px; font-size: 12px;
}
.custom-select[data-size="compact"] .select-option { min-height: 36px; padding: 7px 10px; font-size: 13px; }

@keyframes select-list-in { from { opacity: 0; transform: translateY(-4px) scaleY(.98); } }
@keyframes select-list-up { from { opacity: 0; transform: translateY(4px) scaleY(.98); } }
