.hd-account [hidden], .hd-auth-dialog [hidden] { display: none !important; }
.hd-auth-open { overflow: hidden; }
.hd-user { position: relative; min-width: 0; }
.hd-user summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.hd-user summary::-webkit-details-marker { display: none; }
.hd-user summary .ui-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.hd-user summary > .ui-icon:last-child { transform: rotate(90deg); width: 14px; }
#hd-username { max-width: 116px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-user-menu { position:absolute; right:0; top:calc(100% + 12px); width:min(300px, calc(100vw - 24px)); padding:0; background:#fff; border:1px solid #e4eae5; border-radius:12px; box-shadow:0 8px 28px #1b312226; z-index:50; color:#34433b; font-size:14px; }
.hd-user-menu > a { display:block; padding:14px; }
.hd-user-menu ul { margin:0; list-style:none; }
#hd-avatar { width:24px; height:24px; border-radius:50%; object-fit:cover; }
#hd-avatar:not([hidden]) + .ui-icon { display:none; }
.account-auth-links { gap:16px; }
.hd-auth-dialog { position: fixed; inset: 0; width: min(480px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 1px solid #e2e9e3; border-radius: 14px; background: white; box-shadow: 0 16px 60px #122c2633; overflow: hidden; }
.hd-auth-dialog::backdrop { background: #172c2580; }
.hd-auth-dialog:not([open]) { display: none; }
.hd-auth-dialog iframe { display: block; width: 100%; height: 620px; max-height: calc(100dvh - 24px); border: 0; }
.hd-auth-close { position: absolute; right: 10px; top: 9px; z-index: 2; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f4f7f5; color: #62756a; font: 26px/1 sans-serif; cursor: pointer; }
.hd-auth-close:hover { background: #e6eee9; }
.hd-auth-loading { margin: 60px 24px 32px; text-align: center; color: #62756a; }
.hd-auth-fallback { margin: 0; padding: 12px 20px; font-size: 13px; color: #62756a; }
.hd-auth-fallback a { color: var(--hd-green); text-decoration: underline; }
.hd-auth-dialog :focus-visible, .hd-user :focus-visible, #hd-login:focus-visible { outline: 2px solid var(--hd-green); outline-offset: 3px; }
@media (max-width: 600px) { #hd-username { max-width: 88px; } .hd-user summary > .ui-icon:first-child { display: none; } }
.hd-account { position:relative; }
.hd-user { position:static; }
@media (max-width:380px) { .hd-account { gap:8px; } .hd-account .account-auth-links { gap:8px; font-size:11px; } .hd-logo img { width:96px; height:auto; } }
/* 首页优先展示登录注册，上传作为次要操作。 */
.hd-header .account-auth-links { gap:8px; }
.hd-header .account-auth-links a { min-height:36px; padding:6px 12px; border:1px solid #91be98; border-radius:6px; font-weight:600; color:#fff; }
.hd-header .account-auth-links [data-home-auth-entry="login"] { background:#278426; border-color:#278426; }
.hd-header .account-auth-links a:hover { background:#216f21; border-color:#80bb88; color:#fff; }
.hd-header .hd-account > .hd-button { background:transparent; border-color:#ffffff40; color:#d1d8d3; font-weight:400; box-shadow:none; }
.hd-header .hd-account > .hd-button:hover { background:#ffffff12; border-color:#ffffff70; color:#fff; }
@media (max-width:380px) { .hd-header .account-auth-links { gap:6px; } .hd-header .account-auth-links a { padding:5px 7px; min-height:32px; } .hd-header .hd-account > .hd-button .ui-icon { display:none; } }
.account-login-icon { display:inline-flex; align-items:center; justify-content:center; }
.hd-header .account-login-icon { width:24px; height:24px; border-radius:50%; background:#ffffff1f; border:1px solid #ffffff40; }
.hd-header .account-login-icon .ui-icon { width:16px; height:16px; }
@media (max-width:380px) { .hd-header .account-login-icon { width:20px; height:20px; } }

/* 手机第一行保留品牌和账户入口，上传收为有名称的图标按钮。 */
@media (max-width:540px) {
    .hd-header .hd-header-row { column-gap:10px; }
    .hd-header .hd-logo img { width:104px; height:37px; }
    .hd-header .hd-account { flex:0 0 auto; margin-left:auto; gap:8px; }
    .hd-header .hd-account .account-auth-links { gap:6px; }
    .hd-header .hd-account .account-auth-links a { box-sizing:border-box; height:42px; min-height:42px; padding:5px 6px; }
    .hd-header .account-login-icon { display:inline-flex; width:18px; height:18px; border:0; background:none; }
    .hd-header .hd-account > .site-upload-link { position:relative; box-sizing:border-box; width:34px; height:42px; min-height:42px; padding:6px; }
    .hd-header .hd-account > .site-upload-link .ui-icon { display:block; width:18px; height:18px; }
    .hd-header .hd-account > .site-upload-link .site-bilingual-label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
}
@media (max-width:380px) { .hd-header #hd-username { max-width:64px; } }
