/* Shared account popover, matching the Qianwen-style header. */
.q-header-actions>#q-login.q-account{padding:0;width:2.5rem;height:2.5rem;flex-shrink:0;font-size:var(--text-lg);background:linear-gradient(100deg,#1dc4c7 0%,#7991ff 42%,#6550ff 100%)}
.account-popover{position:fixed;z-index:60;width:21rem;max-width:calc(100vw - 1.5rem);max-height:calc(100dvh - 6.875rem);overflow-y:auto;overscroll-behavior:contain;padding:0.75rem 0.75rem 0.875rem;border:0.0625rem solid #fafafa;border-radius:var(--radius-xl);background:linear-gradient(150deg,#fff 50%,#f6fbff 100%);box-shadow:0 1rem 4.375rem #24243e14,0 0.1875rem 1rem #24243e06;color:#141518}
.account-popover[hidden]{display:none}
.account-summary{padding:1.25rem 1rem 1.125rem;border:0.0625rem solid #d6dae5;border-radius:var(--radius-lg);background:#ffffffa8}
.account-identity{display:flex;align-items:center;gap:0.8125rem;padding-bottom:1.0625rem;border-bottom:0.0625rem solid #d6dae5}
.account-avatar{display:grid;place-items:center;flex-shrink:0;width:2.875rem;height:2.875rem;border-radius:50%;color:#fff;font-size:var(--text-title);background:linear-gradient(100deg,#1dc4c7 0%,#7991ff 42%,#6550ff 100%)}
.account-identity strong{font-size:var(--text-base);font-weight:500;line-height:1.5;overflow-wrap:anywhere;min-width:0}
.account-spending{padding-top:0.875rem}.account-spending>div{display:flex;align-items:center;gap:0.875rem}.account-spending>div>span{font-size:var(--text-base);font-weight:500}.account-bill-badge{padding:0.1875rem 0.5625rem;border-radius:0.4375rem;background:#fff3e9;color:var(--ui-warning);font-size:var(--text-xs);line-height:1.5}.account-spending>strong{display:block;margin-top:0.4375rem;font-size:var(--text-xl);font-weight:600;line-height:1.4}.account-spending>small{display:block;margin-top:0.1875rem;color:var(--ui-muted);font-size:var(--text-xs)}
.account-popover>nav{display:grid;margin-top:0.625rem;gap:0.125rem}.account-popover>nav>a,.account-popover>nav>button{display:flex;align-items:center;gap:0.875rem;width:100%;min-height:2.8125rem;padding:0.625rem 0.8125rem;border-radius:var(--radius-lg);color:#17181c;font-size:var(--text-base);text-align:left;text-decoration:none;background:transparent}.account-popover>nav>a:hover,.account-popover>nav>button:hover{background:#efeff580}.account-popover .d-icon{width:1.25rem;height:1.25rem;flex-shrink:0;stroke-width:1.6}.account-popover :is(a,button):focus-visible,#q-login:focus-visible{outline:0.125rem solid #8b7ae7;outline-offset:0.125rem}
@media(max-width:37.5rem){.account-popover{width:20.375rem;max-height:calc(100dvh - 5.375rem);padding:0.6875rem;border-radius:var(--radius-xl)}.account-summary{padding:1rem}.account-popover>nav>a,.account-popover>nav>button{min-height:2.6875rem}.q-header-actions>#q-login.q-account{width:2.1875rem;height:2.1875rem;font-size:var(--text-base)}}
.account-identity>div{min-width:0}
.account-identity>div>small{display:block;color:#505b6b;font-size:var(--text-xs);margin-top:0.25rem}
.account-spending>strong{min-height:1.875rem;font-variant-numeric:tabular-nums}
#account-balance-status{min-height:1.125rem;line-height:1.6;overflow-wrap:anywhere}
#account-balance-retry{margin-top:0.5rem;color:#59479f;text-decoration:underline;font-size:var(--text-xs);padding:0.25rem 0}
.account-popover .workspace-icon{width:1.25rem;height:1.25rem;flex:none}
body.gallery #q-login.workspace-account-trigger{display:grid;place-items:center;width:2.5rem;height:2.5rem;min-width:2.5rem;min-height:2.5rem;padding:0;border-radius:50%;color:#fff;background:linear-gradient(120deg,#21758b,#6860b8 55%,#7650b2);line-height:1;letter-spacing:0;font-size:var(--text-base);font-weight:500}

/* Shared header menus use the same theme on legacy and React routes. */
.account-popover { box-sizing: border-box; width: min(21rem,calc(100vw - 1.5rem)); max-height: calc(100dvh - var(--header-height) - 1.5rem); border-color: var(--site-header-border); background: var(--site-header-bg); color: var(--site-header-ink); font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif; }
.account-summary { border-color: var(--site-header-border); background: var(--site-header-bg); }
.account-identity { border-color: var(--site-header-border); }
.account-identity > div > small, .account-spending > small { color: var(--site-header-muted); }
.account-popover > nav > :is(a,button) { box-sizing: border-box; border: 0; font-family: inherit; color: var(--site-header-ink); }
.account-popover > nav > :is(a,button):hover { background: color-mix(in srgb,var(--site-header-accent) 10%,transparent); }
.account-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.account-popover .workspace-icon { fill: none; stroke: currentColor; }

html.dark .account-popover .account-spending a.account-bill-badge { background: #3a3047; color: #eadbff; }
