/* 个人资料：原生 <dialog> 打开时铺满视口并居中卡片；关闭必须保持 display:none */
dialog.profile-modal-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    /* 卡片变高后允许在遮罩内滚动，避免裁掉积分下方的厂商余额行 */
    overflow-x: hidden;
    overflow-y: auto;
    background: transparent;
    color: var(--nv-text, #f5f5f7);
    scrollbar-width: thin;
}

dialog.profile-modal-dialog:not([open]) {
    display: none;
}

dialog.profile-modal-dialog[open],
dialog.profile-modal-dialog:modal {
    display: grid;
    place-items: center;
    max-width: none;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 24px 0;
    box-sizing: border-box;
}

dialog.profile-modal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

dialog.profile-modal-dialog .profile-dialog {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: min(92vw, 480px);
    max-width: 480px;
    max-height: none;
    overflow: visible;
    transform: none;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--nv-border, rgba(255, 255, 255, 0.12));
    background: var(--nv-surface, #161b22);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

dialog.profile-modal-dialog .profile-item--avatar {
    display: flex;
    justify-content: center;
}

/* 无头像时不占空行 */
dialog.profile-modal-dialog .profile-item--avatar:has(img[hidden]) {
    display: none;
}

dialog.profile-modal-dialog .profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--nv-border, rgba(255, 255, 255, 0.12));
    background: #0a0a0a;
}

dialog.profile-modal-dialog .profile-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--nv-text-secondary, #8b949e);
}

dialog.profile-modal-dialog .profile-value,
dialog.profile-modal-dialog .invite-link-input {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--nv-border, rgba(255, 255, 255, 0.08));
    background: rgba(255, 255, 255, 0.04);
    color: var(--nv-text, #e6edf3);
    font-size: 15px;
}

dialog.profile-modal-dialog .profile-invite-link {
    display: flex;
    gap: 8px;
}

dialog.profile-modal-dialog .invite-link-input {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

dialog.profile-modal-dialog .copy-link-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: var(--nv-gradient-brand, linear-gradient(135deg, #5a8f00, #76b900));
    color: #0a0a0a;
    font-weight: 600;
    cursor: pointer;
}

dialog.profile-modal-dialog .profile-item--actions {
    margin-top: 4px;
}

dialog.profile-modal-dialog .profile-change-password-btn {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(118, 185, 0, 0.45);
    border-radius: 8px;
    background: rgba(118, 185, 0, 0.12);
    color: #76b900;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

dialog.profile-modal-dialog .profile-change-password-btn:hover {
    background: rgba(118, 185, 0, 0.22);
    border-color: #76b900;
}
