/* Shared account chrome for the product shell and Creator. */
.account-shell {
  --account-bg: var(--theme-surface, #fff);
  --account-text: var(--theme-text, #252529);
  --account-muted: var(--theme-text-soft, #6b6b72);
  --account-line: var(--theme-line, rgba(0,0,0,.12));
  position: relative; display: flex; flex: 0 0 auto; min-width: 0; color: var(--account-text);
}
html[data-theme="dark"] .account-shell { --account-bg: var(--theme-surface, #1c2028); --account-text: var(--theme-text, #f2f0eb); --account-muted: var(--theme-text-soft, #a5abb6); --account-line: var(--theme-line, rgba(255,255,255,.15)); }
.account-shell[hidden], .account-shell [hidden] { display: none !important; }
.account-shell .account-entry { width: auto; min-width: 0; flex: 1 1 auto; min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 1px solid transparent; border-radius: 12px; color: var(--account-text); background: transparent; cursor: pointer; font: inherit; text-align: left; }
.account-shell .account-entry:hover, .account-shell .account-entry[aria-expanded="true"] { border-color: var(--account-line); background: var(--account-bg); }
.account-shell .account-avatar { width: 32px; height: 32px; flex: 0 0 32px; object-fit: cover; border-radius: 50%; }
.account-shell .account-avatar-lg { width: 40px; height: 40px; flex-basis: 40px; }
.account-shell .account-entry-copy, .account-shell .account-popover-identity { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-shell .account-entry-copy { flex: 1; }
.account-shell .account-entry-copy strong, .account-shell .account-popover-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--account-text); font-size: 13px; }
.account-shell .account-entry-copy span, .account-shell .account-popover-identity span { color: var(--account-muted); font-size: 11px; }
.account-shell .account-entry-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-shell .account-entry-side { display: flex; flex-direction: column; flex: 0 0 auto; align-items: flex-end; gap: 2px; }
.account-shell .wallet-balance { display: inline-block; flex: 0 0 auto; margin: 0; padding: 3px 6px; border: 1px solid var(--account-line); border-radius: 7px; color: var(--account-text); background: transparent; font: inherit; font-size: 11px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.account-shell .wallet-recharge { align-self: center; flex: 0 0 auto; margin-left: 4px; padding: 4px 7px; border: 1px solid rgba(183,148,67,.55); border-radius: 7px; color: var(--account-text); background: rgba(183,148,67,.16); font: inherit; font-size: 12px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.account-shell .wallet-recharge:hover { background: rgba(183,148,67,.26); }
#global-nav .account-shell .wallet-recharge { color: #FBBF24; }
.account-shell .account-chevron { color: var(--account-muted); font-size: 12px; line-height: 1; }
.account-shell .account-popover { box-sizing: border-box; position: absolute; z-index: 120; top: calc(100% + 8px); right: 0; bottom: auto; left: auto; width: min(300px, calc(100vw - 24px)); max-height: calc(100dvh - 90px); overflow-y: auto; padding: 9px; border: 1px solid var(--account-line); border-radius: 14px; background: var(--account-bg); color: var(--account-text); box-shadow: 0 15px 45px rgba(0,0,0,.18); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
.account-shell .account-popover.show { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.sidebar > .account-shell .account-popover { top: auto; bottom: calc(100% + 8px); left: 10px; right: 10px; width: auto; }
.account-shell .account-popover-head { display: flex; align-items: center; gap: 10px; padding: 6px 6px 12px; border-bottom: 1px solid var(--account-line); }
.account-shell .account-wallet-summary { padding: 11px 6px 5px; font-size: 12px; }
.account-shell .account-wallet-summary > div, .account-shell .account-balance-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.account-shell .account-balance-link { color: inherit; text-decoration: none; cursor: pointer; }
.account-shell span.wallet-balance { cursor: default; }
.account-shell .account-wallet-summary span, .account-shell .account-wallet-summary small { color: var(--account-muted); }
.account-shell .account-wallet-summary strong { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.account-shell #account-refresh-status:empty { display: none; }
.account-shell .account-menu-links { padding-top: 4px; }
.account-shell .account-contexts { padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--account-line); }
.account-shell .account-contexts > small { display: block; padding: 3px 10px 5px; color: var(--account-muted); font-size: 11px; }
.account-shell .account-menu-link, .account-shell .account-logout { box-sizing: border-box; display: flex; align-items: center; width: 100%; min-height: 36px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--account-text); text-decoration: none; text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.account-shell .account-menu-link:hover, .account-shell .account-logout:hover { background: color-mix(in srgb, var(--account-text) 7%, transparent); }
.account-shell .account-logout { margin-top: 6px; border-top: 1px solid var(--account-line); border-radius: 0 0 8px 8px; color: #bb5353; }
.account-shell :focus-visible { outline: 2px solid #b79443; outline-offset: 2px; }
.workspace-account-host { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.workspace-account-host:empty { display: none; }
.workspace-account-host .account-shell { padding: 0; border: 0; }
.workspace-account-host .account-entry-copy { max-width: 140px; min-width: 0; }
.workspace-account-host .account-entry { width: auto; }
.app.sidebar-hidden > .content > .topbar { display: flex; }
.app.sidebar-hidden > .content > .topbar #page-title, .app.sidebar-hidden > .content > .topbar #menu-toggle { display: none; }
.app > .content > .topbar, .v2-shell > .topbar { position: relative; z-index: 25; overflow: visible; }
.product-global-account .account-shell .wallet-balance { display: inline-block; }
@media (max-width: 768px) {
  .v2-shell { grid-template-rows: auto auto minmax(0, 1fr); }
  .workspace-account-host .account-entry-copy, .product-global-account .account-shell .account-entry-copy { display: none; }
  .workspace-account-host .account-entry { min-height: 38px; padding: 3px; gap: 6px; }
  .workspace-account-host .account-entry-side { flex-direction: row; }
  .workspace-account-host .account-chevron { display: none; }
  .v2-shell > .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .v2-shell > .topbar .brand { min-width: 0; }
  .v2-shell > .topbar .brand strong { font-size: 13px; }
  .v2-shell > .topbar .brand-mark { width: 28px; height: 28px; }
  .v2-shell > .topbar .project-picker { order: 2; flex: 1 1 60%; min-width: 0; }
  .v2-shell > .topbar .project-picker select { width: min(240px, 48vw); }
  .v2-shell > .topbar .workspace-fullscreen-button { order: 2; font-size: 11px; padding: 0 8px; }
  .v2-shell > .topbar .topbar-spacer { display: none; }
}
@media (prefers-reduced-motion: reduce) { .account-shell .account-popover { transition: none; } }

/* 充值入口：直接放在余额下方，点开菜单即可看到 */
.account-shell .account-recharge { box-sizing: border-box; display: block; width: 100%; min-height: 32px; margin-top: 8px; padding: 6px 10px; border: 1px solid color-mix(in srgb, #b79443 55%, transparent); border-radius: 8px; background: color-mix(in srgb, #b79443 12%, transparent); color: var(--account-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.account-shell .account-recharge:hover { background: color-mix(in srgb, #b79443 22%, transparent); }
.account-shell .account-recharge[hidden] { display: none; }

/* 2026-11-14：切换工作室身份卡片，与下方普通菜单分层 */
.account-shell #account-context-list { display: grid; gap: 6px; padding: 2px 4px 6px; }
.account-shell .account-context-item {
  box-sizing: border-box; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center; gap: 9px; width: 100%; min-height: 50px; padding: 7px 9px;
  border: 1px solid var(--account-line); border-radius: 10px;
  background: var(--account-bg); color: var(--account-text);
  text-align: left; font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.account-shell .account-context-item:hover { border-color: color-mix(in srgb, #b79443 60%, transparent); background: color-mix(in srgb, #b79443 8%, var(--account-bg)); }
.account-shell .account-context-avatar {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: color-mix(in srgb, var(--account-text) 9%, transparent);
  color: var(--account-muted); font-size: 12px; font-weight: 700;
}
.account-shell .account-context-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-shell .account-context-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.account-shell .account-context-role { color: var(--account-muted); font-size: 11px; }
.account-shell .account-context-badge {
  justify-self: end; padding: 2px 7px; border: 1px solid var(--account-line); border-radius: 999px;
  color: var(--account-muted); font-size: 11px; white-space: nowrap;
}
.account-shell .account-context-item.is-current {
  border-color: color-mix(in srgb, #b79443 65%, transparent);
  background: color-mix(in srgb, #b79443 12%, var(--account-bg)); cursor: default;
}
.account-shell .account-context-item.is-current:hover { background: color-mix(in srgb, #b79443 12%, var(--account-bg)); }
.account-shell .account-context-item.is-current .account-context-avatar {
  background: color-mix(in srgb, #b79443 26%, transparent); color: var(--gold, #c9a95d);
}
.account-shell .account-context-item.is-current .account-context-badge {
  border-color: color-mix(in srgb, #b79443 60%, transparent);
  background: color-mix(in srgb, #b79443 18%, transparent);
  color: var(--gold, #c9a95d); font-weight: 650;
}
.account-shell .account-context-item:disabled { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .account-shell .account-context-item { transition: none; } }
