/* 单选下拉统一主题；保留原生表单、禁用和键盘语义，多选/列表框仍用原有样式。 */
body select:not([multiple]):not([size]),
body select[size="1"]:not([multiple]) {
  appearance: none;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 30px 5px 10px;
  border: 1px solid #e4dff2;
  border-radius: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5' fill='none' stroke='%238d7bbe' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center, #fff;
  color: #655b7b;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  vertical-align: middle;
  cursor: pointer;
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}
body select:not([multiple]):not([size]):hover,
body select[size="1"]:not([multiple]):hover { border-color: #c5b7ee; background-color: #f2efff; }
body select:not([multiple]):not([size]):focus-visible,
body select[size="1"]:not([multiple]):focus-visible { outline: 2px solid #b9a9ef; outline-offset: 2px; }
body select:not([multiple]):not([size]):disabled,
body select[size="1"]:not([multiple]):disabled { background-color: #f6f5f9; color: #a2a0af; cursor: not-allowed; opacity: .7; }

/* 原生可定制菜单进入浏览器顶层，避免被输入框、表格或弹窗的滚动区域裁切。 */
@supports (appearance: base-select) {
  body select:not([multiple]):not([size]),
  body select[size="1"]:not([multiple]) {
    appearance: base-select !important;
    background-image: none !important;
    padding-inline-end: 10px !important;
    gap: 12px;
  }
  body select::picker(select) {
    appearance: base-select;
    box-sizing: border-box;
    min-inline-size: anchor-size(width);
    max-inline-size: min(460px, calc(100vw - 24px));
    max-block-size: min(340px, 55dvh);
    margin-block: 6px;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #e3dcf3;
    border-radius: 12px;
    background: #fff;
    color: #655b7b;
    box-shadow: 0 12px 36px #55447924, 0 2px 6px #5544790a;
    scrollbar-width: thin;
    scrollbar-color: #d7cdec transparent;
  }
  body select::picker-icon {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    margin-inline-start: auto;
    border-right: 1.5px solid #8d7bbe;
    border-bottom: 1.5px solid #8d7bbe;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .16s;
  }
  body select:open::picker-icon { transform: translateY(2px) rotate(225deg); }
  body :is(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: #fff !important;
    color: #655b7b !important;
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
  }
  body :is(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) option:hover,
  body :is(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) option:focus-visible { background: #f2efff !important; color: #7257c6 !important; outline: none; }
  body :is(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) option:checked { background: #ece6ff !important; color: #6846df !important; font-weight: 600; }
  body :is(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) option::checkmark { order: 1; margin-inline-start: auto; color: #7257c6; font-size: 12px; }
  body :is(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) option:disabled { color: #aaa4b7 !important; cursor: not-allowed; }
  body :is(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) optgroup { padding: 4px 0; color: #8d839f; font-size: 11px; }
  body :is(select:not([multiple]):not([size]), select[size="1"]:not([multiple])) optgroup + optgroup { margin-top: 4px; border-top: 1px solid #f0ecf6; }
}
@media (prefers-reduced-motion: reduce) {
  body select,
  body select::picker-icon { transition: none !important; }
}
