.ml-page {
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ml-page .page-head {
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(20px, 2.3vw, 36px);
}

.ml-page .page-head h1 {
  font-size: clamp(26px, 2vw, 34px);
  line-height: 1.25;
  letter-spacing: -.04em;
  color: var(--ink);
}

.scope-field {
  position: relative;
  min-width: 0;
}
.scope-cloud { width: clamp(184px, 20vw, 265px); max-width: 100%; }
.scope-trigger {
  display: grid; grid-template-columns: 29px minmax(0,1fr) 14px; align-items: center; gap: 9px;
  width: 100%; min-height: var(--account-control-height); padding: 3px 11px 3px 7px; text-align: left; font: inherit;
  color: #293345; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--control-radius);
  box-shadow: var(--control-shadow);
}
.scope-trigger:hover { border-color: #a8b1c8; }
.scope-trigger[aria-expanded="true"] { border-color: var(--blue-strong); }
.scope-trigger > svg { color: #768195; width: 13px; height: 13px; }
.scope-avatar {
  display: grid; place-items: center; width: 29px; height: 29px; border-radius: var(--radius-small); overflow: hidden;
  color: var(--blue-strong); background: var(--blue-soft);
}
.scope-avatar:has(img) { background: transparent; }
.scope-avatar svg { width: 17px; height: 17px; }
.scope-avatar .desk-platform-icon { width: 100%; height: 100%; object-fit: contain; }
.scope-caption { display: grid; min-width: 0; gap: 2px; }
.scope-caption small { font-size: var(--small-label); line-height: 1.1; color: #646f82; }
.scope-caption strong {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--type-ui); line-height: 1.35; font-weight: 630;
}
.scope-field select.scope-value {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px; min-width: 0; min-height: 0;
  margin: 0; padding: 0; border: 0; opacity: 0; clip-path: inset(50%); pointer-events: none;
}
.scope-panel {
  position: fixed; z-index: 20; inset: auto; margin: 0; padding: 0; overflow: hidden;
  border: 1px solid #cdd4df; border-radius: var(--radius-panel); background: #fff; color: #293345;
  box-shadow: var(--popover-shadow); font-family: inherit; text-align: left;
}
.scope-panel:not([hidden]) { display: flex; flex-direction: column; }
.scope-panel[hidden] { display: none; }
.scope-search {
  flex: none; display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 8px 13px; border-bottom: 1px solid #e3e7ed; background: white; color: #778397;
}
.scope-search svg { width: 16px; height: 16px; }
.scope-search input {
  box-sizing: border-box; min-width: 0; width: 100%; min-height: 30px; margin: 0; padding: 3px 2px; border: 0;
  outline: 0; background: transparent; color: #263047; box-shadow: none; font: inherit; font-size: var(--type-ui);
}
.scope-search:focus-within { border-bottom-color: var(--blue-strong); }
.scope-panel .scope-search input:focus-visible { outline: none; box-shadow: none; }
.scope-options { min-height: 0; max-height: 330px; overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.scope-restore {
  flex: none; min-height: 40px; padding: 8px 13px; border: 0; border-top: 1px solid #e3e7ed;
  background: #fff; color: var(--blue-strong); text-align: left; font: inherit; font-size: var(--type-ui); cursor: pointer;
}
.scope-restore:is(:hover,:focus-visible) { background: var(--blue-soft); }
.scope-restore:focus-visible { outline: 2px solid var(--blue-strong); outline-offset: -3px; }
.scope-restore[hidden] { display: none; }
.scope-option {
  display: grid; grid-template-columns: 28px minmax(0,1fr) 15px; align-items: center; gap: 10px;
  min-height: 43px; margin: 0; padding: 6px 9px; line-height: 1.3; border-radius: var(--radius-small); cursor: pointer;
}
.scope-option .scope-avatar { width: 26px; height: 26px; }
.scope-option-text { display: grid; gap: 2px; min-width: 0; }
.scope-option .scope-option-text strong {
  font-size: var(--type-ui); line-height: 1.4; font-weight: 550; color: #283246;
  white-space: normal; overflow-wrap: anywhere; text-overflow: clip; overflow: visible;
}
.scope-option-text small { font-size: var(--small-label); line-height: 1.3; color: #657084; overflow-wrap: anywhere; }
.scope-option:is(:hover,.scope-active) { background: #f0f3f8; }
.scope-option[aria-selected="true"] { background: var(--blue-soft); }
.scope-option[aria-selected="true"] > svg { width: 15px; height: 15px; color: var(--blue-strong); stroke-width: 2; }
.scope-empty { padding: 18px 12px; text-align: center; color: #657084; font-size: var(--type-ui); }

.ml-page :where(input, select, a, button, summary):focus-visible {
  outline: 2px solid var(--blue-strong);
  outline-offset: 3px;
}

@media (max-width: 620px) {
  .ml-page .page-head { align-items: stretch; }
  .shell .page-head:has(.scope-cloud) { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
  .shell .page-head:has(.scope-cloud) .actions { justify-content: start; }
  .scope-cloud { width: min(265px,100%); }
  .page-head .actions > .btn + .scope-cloud { flex: 1 1 155px; max-width: 265px; }
}

.ml-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 51px;
  height: 51px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ml-avatar);
  color: white;
}
.ml-avatar-tone-0 { --ml-avatar: linear-gradient(145deg, #324e4b, #567d65); }
.ml-avatar-tone-1 { --ml-avatar: linear-gradient(145deg, #864925, #ad7546); }
.ml-avatar-tone-2 { --ml-avatar: linear-gradient(145deg, #51456e, #796398); }
.ml-avatar::before {
  position: absolute;
  content: "";
  width: 105%;
  height: 60%;
  border: 1px solid #ffffff45;
  border-radius: 50%;
  box-shadow: 0 3px 0 2px #ffffff15;
  bottom: -24%;
  left: -15%;
  transform: rotate(-25deg);
}
.ml-avatar > span { position: relative; font: 600 17px/1 "Songti SC", "Noto Serif CJK SC", serif; letter-spacing: .04em; }

.ml-avatar-small { width: 28px; height: 28px; }
.ml-avatar-small > span { font-size: 10px; letter-spacing: 0; }

.ml-page [data-list-reset] { margin: 0; min-height: 36px; white-space: nowrap; }
.ml-page [data-list-reset]:disabled { color: var(--muted); background: #f2f4f7; cursor: default; }
.ml-reset {
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: var(--control-radius);
  border: 0;
  background: var(--blue-soft);
  color: #504598;
  font-size: var(--type-ui);
}

@media (max-width: 620px) {
  .shell .page-head:has(.scope-cloud):has(.list-share-trigger) {
    position: relative;
  }
  .shell .page-head:has(.scope-cloud):has(.list-share-trigger) > div:first-child {
    padding-inline-end: 104px;
    min-height: 36px;
  }
  .shell .page-head:has(.scope-cloud) .list-share-trigger {
    position: absolute;
    inset: 0 0 auto auto;
  }
  .shell .page-head:has(.scope-cloud) > .actions {
    width: 100%;
    justify-content: flex-end;
  }
}
